|
|
@@ -7,127 +7,29 @@
|
|
|
<select id="listCustom"
|
|
|
parameterType="com.crm.rely.backend.model.entity.custom.info.CustomSearchEntity"
|
|
|
resultType="com.crm.rely.backend.model.pojo.view.CustomView">
|
|
|
- select custom.id,first_name,middle
|
|
|
- middle,last_name,custom.email,custom.country,custom.country_name,custom.country_en_name,custom.identity,
|
|
|
- custom.name_en,custom.head_picture,custom.phone,
|
|
|
- custom.add_ip, custom.approve_time, custom.
|
|
|
- last_time,custom.birth,custom.valid,custom.add_time,custom.last_ip,custom.`status`,ifnull(custom.apply_real_status,0)
|
|
|
- apply_real_status,custom.apply_real_time,custom.approve_desc,custom.approve_time,custom.c_id,agent.ib_no as
|
|
|
- agent_ib_no,sales.ib_no sales_ib_no,
|
|
|
- custom.agent_id, custom.sno
|
|
|
+ select custom.*
|
|
|
from custom_info custom
|
|
|
- left join user_info agent on agent.id = custom.agent_id
|
|
|
- left join user_info sales on sales.id = agent.sales_id
|
|
|
<where>
|
|
|
- <if test="stamp != null">
|
|
|
- and agent.stamp like binary concat(#{stamp},'%')
|
|
|
- </if>
|
|
|
- <!-- <if test="(groupId!=null and groupId > 0)">-->
|
|
|
- <!-- and agent.group_id = #{groupId}-->
|
|
|
- <!-- </if>-->
|
|
|
-
|
|
|
- <if test="email != null and email !=''">
|
|
|
- and custom.email =#{email}
|
|
|
+ <if test="name != null and name !=''">
|
|
|
+ and custom.name line concat ('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="email != null and email !=''">
|
|
|
- and custom.email =#{email}
|
|
|
- </if>
|
|
|
- <if test="agentIbNo != null and agentIbNo !=''">
|
|
|
- and agent.ib_no like binary concat(#{agentIbNo},'%')
|
|
|
- </if>
|
|
|
- <if test="salesIbNo != null and salesIbNo !=''">
|
|
|
- and sales.ib_no like binary concat(#{salesIbNo},'%')
|
|
|
- </if>
|
|
|
- <if test="lastIp != null and lastIp !=''">
|
|
|
- and custom.last_ip like binary concat(#{lastIp},'%')
|
|
|
+ and custom.email line concat (#{email},'%')
|
|
|
</if>
|
|
|
<if test="identity != null and identity !=''">
|
|
|
- and custom.identity =#{identity}
|
|
|
+ and custom.identity = #{identity}
|
|
|
</if>
|
|
|
<if test="cId != null">
|
|
|
and custom.c_id =#{cId}
|
|
|
</if>
|
|
|
<if test="startDate != null">
|
|
|
- <if test="status!=null">
|
|
|
- and custom.add_time <![CDATA[>=]]>#{startDate}
|
|
|
- </if>
|
|
|
- <if test="status==null">
|
|
|
- and custom.approve_time <![CDATA[>=]]>#{startDate}
|
|
|
- </if>
|
|
|
+ and custom.add_time <![CDATA[>=]]>#{startDate}
|
|
|
</if>
|
|
|
<if test="endDate != null">
|
|
|
- <if test="status!=null">
|
|
|
- and custom.add_time <![CDATA[<=]]>#{endDate}
|
|
|
- </if>
|
|
|
- <if test="status==null">
|
|
|
- and custom.approve_time <![CDATA[<=]]>#{endDate}
|
|
|
- </if>
|
|
|
+ and custom.add_time <![CDATA[<=]]>#{endDate}
|
|
|
</if>
|
|
|
- <if test="status!=null">
|
|
|
- <if test="status==0">
|
|
|
- <if test="potentialStatus==null">
|
|
|
- and (custom.status in (1,3) and ( custom.apply_real_status in(0,3) or custom.apply_real_status
|
|
|
- is null))
|
|
|
- </if>
|
|
|
- <if test="potentialStatus!=null">
|
|
|
- <if test="potentialStatus==0">
|
|
|
- and (custom.apply_real_status =0 or custom.apply_real_status is null)
|
|
|
- </if>
|
|
|
- <if test="potentialStatus==1">
|
|
|
- and (custom.status = 3 or custom.apply_real_status=3)
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="status==1">
|
|
|
- and (custom.status =1 and custom.apply_real_status=1)
|
|
|
- </if>
|
|
|
- <if test="status==2">
|
|
|
- and (custom.status =2 )
|
|
|
- </if>
|
|
|
- <if test="status==3">
|
|
|
- and (custom.status = 3 or custom.apply_real_status=3)
|
|
|
- </if>
|
|
|
- </if>
|
|
|
-
|
|
|
</where>
|
|
|
- <if test="status!=null">
|
|
|
- <if test="status==1">
|
|
|
- order by
|
|
|
- <if test="sortType!=null and sortName!=null and sortName !=''">
|
|
|
- <if test="sortType==1">
|
|
|
- custom.${sortName},
|
|
|
- </if>
|
|
|
- <if test="sortType==2">
|
|
|
- custom.${sortName} desc,
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- custom.apply_real_time desc,custom.status asc
|
|
|
- </if>
|
|
|
- <if test="status!=1">
|
|
|
- order by
|
|
|
- <if test="sortType!=null and sortName!=null and sortName !=''">
|
|
|
- <if test="sortType==1">
|
|
|
- custom.${sortName},
|
|
|
- </if>
|
|
|
- <if test="sortType==2">
|
|
|
- custom.${sortName} desc,
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- custom.add_time desc,custom.status asc
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="status==null">
|
|
|
- order by
|
|
|
- <if test="sortType!=null and sortName!=null and sortName !=''">
|
|
|
- <if test="sortType==1">
|
|
|
- custom.${sortName},
|
|
|
- </if>
|
|
|
- <if test="sortType==2">
|
|
|
- custom.${sortName} desc,
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- custom.approve_time desc, custom.add_time desc,custom.status asc
|
|
|
- </if>
|
|
|
+ order by custom.add_time desc
|
|
|
<if test="page != null">
|
|
|
limit #{page.offset},#{page.row}
|
|
|
</if>
|
|
|
@@ -138,26 +40,12 @@
|
|
|
resultType="Integer">
|
|
|
select count(*)
|
|
|
from custom_info custom
|
|
|
- left join user_info agent on agent.id = custom.agent_id
|
|
|
- left join user_info sales on sales.id = agent.sales_id
|
|
|
<where>
|
|
|
- <if test="stamp != null">
|
|
|
- and agent.stamp like binary concat(#{stamp},'%')
|
|
|
+ <if test="name != null and name !=''">
|
|
|
+ and custom.name line concat ('%',#{name},'%')
|
|
|
</if>
|
|
|
- <!-- <if test="groupId != null and groupId > 0">-->
|
|
|
- <!-- and agent.group_id = #{groupId}-->
|
|
|
- <!-- </if>-->
|
|
|
<if test="email != null and email !=''">
|
|
|
- and custom.email =#{email}
|
|
|
- </if>
|
|
|
- <if test="agentIbNo != null and agentIbNo !=''">
|
|
|
- and agent.ib_no like binary concat(#{agentIbNo},'%')
|
|
|
- </if>
|
|
|
- <if test="salesIbNo != null and salesIbNo !=''">
|
|
|
- and sales.ib_no like binary concat(#{salesIbNo},'%')
|
|
|
- </if>
|
|
|
- <if test="lastIp != null and lastIp !=''">
|
|
|
- and custom.last_ip like binary concat(#{lastIp},'%')
|
|
|
+ and custom.email line concat ('%',#{email},'%')
|
|
|
</if>
|
|
|
<if test="identity != null and identity !=''">
|
|
|
and custom.identity =#{identity}
|
|
|
@@ -166,45 +54,10 @@
|
|
|
and custom.c_id =#{cId}
|
|
|
</if>
|
|
|
<if test="startDate != null">
|
|
|
- <if test="status!=null">
|
|
|
- and custom.add_time <![CDATA[>=]]>#{startDate}
|
|
|
- </if>
|
|
|
- <if test="status==null">
|
|
|
- and custom.approve_time <![CDATA[>=]]>#{startDate}
|
|
|
- </if>
|
|
|
+ and custom.add_time <![CDATA[>=]]>#{startDate}
|
|
|
</if>
|
|
|
<if test="endDate != null">
|
|
|
- <if test="status!=null">
|
|
|
- and custom.add_time <![CDATA[<=]]>#{endDate}
|
|
|
- </if>
|
|
|
- <if test="status==null">
|
|
|
- and custom.approve_time <![CDATA[<=]]>#{endDate}
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="status!=null">
|
|
|
- <if test="status==0">
|
|
|
- <if test="potentialStatus==null">
|
|
|
- and (custom.status in (1,3) and ( custom.apply_real_status in(0,3) or custom.apply_real_status
|
|
|
- is null))
|
|
|
- </if>
|
|
|
- <if test="potentialStatus!=null">
|
|
|
- <if test="potentialStatus==0">
|
|
|
- and (custom.apply_real_status =0 or custom.apply_real_status is null)
|
|
|
- </if>
|
|
|
- <if test="potentialStatus==1">
|
|
|
- and (custom.status = 3 or custom.apply_real_status=3)
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="status==1">
|
|
|
- and (custom.status =1 and custom.apply_real_status=1)
|
|
|
- </if>
|
|
|
- <if test="status==2">
|
|
|
- and (custom.status =2 )
|
|
|
- </if>
|
|
|
- <if test="status==3">
|
|
|
- and (custom.status = 3 or custom.apply_real_status=3)
|
|
|
- </if>
|
|
|
+ and custom.add_time <![CDATA[<=]]>#{endDate}
|
|
|
</if>
|
|
|
|
|
|
</where>
|