| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.management.platform.mapper.ClueMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.management.platform.entity.Clue">
- <id column="id" property="id" />
- <result column="company_id" property="companyId" />
- <result column="clue_name" property="clueName" />
- <result column="clue_source_id" property="clueSourceId" />
- <result column="phone" property="phone" />
- <result column="email" property="email" />
- <result column="customer_industry_id" property="customerIndustryId" />
- <result column="customer_level_id" property="customerLevelId" />
- <result column="address" property="address" />
- <result column="incharger_id" property="inchargerId" />
- <result column="remark" property="remark" />
- <result column="is_delete" property="isDelete" />
- <result column="plate1" property="plate1" />
- <result column="plate2" property="plate2" />
- <result column="plate3" property="plate3" />
- <result column="plate4" property="plate4" />
- <result column="plate5" property="plate5" />
- <result column="company_name" property="companyName" />
- <result column="create_time" property="createTime" />
- <result column="create_id" property="createId" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, company_id, clue_name, clue_source_id, phone , email, customer_industry_id, customer_level_id, address, incharger_id, remark, is_delete, plate1, plate2, plate3, plate4, plate5,create_time,createId
- </sql>
- <select id="list" resultType="com.management.platform.entity.Clue">
- select c.id,
- c.company_id,
- (select company_name from company where company_id = c.id) companyName,
- c.clue_name,
- c.clue_source_id,
- c.phone,
- c.email,
- c.customer_industry_id,
- c.customer_level_id,
- c.address,
- c.incharger_id,
- c.remark,
- c.is_delete,
- c.plate1,
- c.plate2,
- c.plate3,
- c.plate4,
- c.plate5,
- c.create_time,
- c.create_id
- from Clue c
- where
- c.company_id = #{companyId} and is_delete = 0
- <if test="startTime != null and endTime != null ">
- and c.create_time BETWEEN #{startTime} and #{endTime}
- </if>
- <if test="clueName != null and clueName != '' ">
- and c.clue_name = #{clueName}
- </if>
- <if test="clueSourceId != null">
- and c.clue_source_id = #{clueSourceId}
- </if>
- <if test="customerIndustryId != null">
- and c.customer_industry_id = #{customerIndustryId}
- </if>
- limit #{pageIndex},#{pageFrom}
- </select>
- <select id="list1" resultType="com.management.platform.entity.Clue">
- select c.id,
- c.company_id,
- (select company_name from company where company_id = c.id) companyName,
- c.clue_name,
- c.clue_source_id,
- c.phone,
- c.email,
- c.customer_industry_id,
- c.customer_level_id,
- c.address,
- c.incharger_id,
- c.remark,
- c.is_delete,
- c.plate1,
- c.plate2,
- c.plate3,
- c.plate4,
- c.plate5,
- c.create_time,
- c.create_id
- from Clue c
- where
- c.company_id = #{companyId} and is_delete = 0
- and c.incharger_id in
- (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
- and c.incharger_id is null
- <if test="startTime != null and endTime != null ">
- and c.create_time BETWEEN #{startTime} and #{endTime}
- </if>
- <if test="clueName != null and clueName != '' ">
- and c.clue_name = #{clueName}
- </if>
- <if test="clueSourceId != null">
- and c.clue_source_id = #{clueSourceId}
- </if>
- <if test="customerIndustryId != null">
- and c.customer_industry_id = #{customerIndustryId}
- </if>
- limit #{pageIndex},#{pageFrom}
- </select>
- <select id="list2" resultType="com.management.platform.entity.Clue">
- select c.id,
- c.company_id,
- (select company_name from company where company_id = c.id) companyName,
- c.clue_name,
- c.clue_source_id,
- c.phone,
- c.email,
- c.customer_industry_id,
- c.customer_level_id,
- c.address,
- c.incharger_id,
- c.remark,
- c.is_delete,
- c.plate1,
- c.plate2,
- c.plate3,
- c.plate4,
- c.plate5,
- c.create_time,
- c.create_id
- from Clue c
- where
- c.company_id = #{companyId} and is_delete = 0
- and c.incharger_id = #{userId} and c.incharger_id is null
- <if test="startTime != null and endTime != null ">
- and c.create_time BETWEEN #{startTime} and #{endTime}
- </if>
- <if test="clueName != null and clueName != '' ">
- and c.clue_name = #{clueName}
- </if>
- <if test="clueSourceId != null">
- and c.clue_source_id = #{clueSourceId}
- </if>
- <if test="customerIndustryId != null">
- and c.customer_industry_id = #{customerIndustryId}
- </if>
- limit #{pageIndex},#{pageFrom}
- </select>
- <select id="Deleterlist" resultType="com.management.platform.entity.Clue">
- select c.id,
- c.company_id,
- (select company_name from company where company_id = c.id) companyName,
- c.clue_name,
- c.clue_source_id,
- c.phone,
- c.email,
- c.customer_industry_id,
- c.customer_level_id,
- c.address,
- c.incharger_id,
- c.remark,
- c.is_delete,
- c.plate1,
- c.plate2,
- c.plate3,
- c.plate4,
- c.plate5,
- c.create_time,
- c.create_id
- from Clue c
- where
- c.company_id = #{companyId} and is_delete = 1
- <if test="startTime != null and endTime != null ">
- and c.create_time BETWEEN #{startTime} and #{endTime}
- </if>
- <if test="clueName != null and clueName != '' ">
- and c.clue_name = #{clueName}
- </if>
- <if test="clueSourceId != null">
- and c.clue_source_id = #{clueSourceId}
- </if>
- <if test="customerIndustryId != null">
- and c.customer_industry_id = #{customerIndustryId}
- </if>
- limit #{pageIndex},#{pageFrom}
- </select>
- <select id="getTotal" resultType="java.lang.Integer">
- select count(*)
- from Clue c
- where
- c.company_id = #{companyId} and is_delete = 0
- <if test="startTime != null and endTime != null ">
- and c.create_time BETWEEN #{startTime} and #{endTime}
- </if>
- <if test="clueName != null and clueName != '' ">
- and c.clue_name = #{clueName}
- </if>
- <if test="clueSourceId != null">
- and c.clue_source_id = #{clueSourceId}
- </if>
- <if test="customerIndustryId != null">
- and c.customer_industry_id = #{customerIndustryId}
- </if>
- </select>
- <select id="getDeleterTotal" resultType="java.lang.Integer">
- select count(*)
- from Clue c
- where
- c.company_id = #{companyId} and is_delete = 1
- <if test="startTime != null and endTime != null ">
- and c.create_time BETWEEN #{startTime} and #{endTime}
- </if>
- <if test="clueName != null and clueName != '' ">
- and c.clue_name = #{clueName}
- </if>
- <if test="clueSourceId != null">
- and c.clue_source_id = #{clueSourceId}
- </if>
- <if test="customerIndustryId != null">
- and c.customer_industry_id = #{customerIndustryId}
- </if>
- </select>
- </mapper>
|