|
|
@@ -788,6 +788,94 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectBusinessManageList" resultType="com.goafanti.customer.bo.BusinessListBo">
|
|
|
+ select
|
|
|
+ c.name as businessName,
|
|
|
+ b.identify_name as identifyName,
|
|
|
+ a.id as businessId,
|
|
|
+ a.create_time as createTime,
|
|
|
+ a.update_time as updateTime,
|
|
|
+ a.follow_situation as followSituation,
|
|
|
+ a.customer_status as customerStatus,
|
|
|
+ d.name as adminName
|
|
|
+ from
|
|
|
+ user_business a inner join user b on
|
|
|
+ a.uid = b.id left join business_glossory c on
|
|
|
+ a.business_glossory_id = c.id left join admin d on
|
|
|
+ a.aid = d.id
|
|
|
+ LEFT JOIN department_management dm on dm.id = d.department_id
|
|
|
+ where 1 = 1
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ and (b.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
|
|
|
+ </if>
|
|
|
+ <if test="uid != null and uid !=''">
|
|
|
+ and a.uid = #{uid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="businessGlossoryId !=null and businessGlossoryId != ''">
|
|
|
+ and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="identifyName != null and identifyName != ''">
|
|
|
+ and b.identify_name like concat('%', #{identifyName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="followSituation != null">
|
|
|
+ and a.follow_situation = #{followSituation,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="customerStatus != null">
|
|
|
+ and a.customer_status = #{customerStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="adminName != null and adminName != ''">
|
|
|
+ and d.name = #{adminName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectBusinessManageCount" parameterType="com.goafanti.customer.bo.BusinessListBo" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(0)
|
|
|
+ from
|
|
|
+ user_business a inner join user b on
|
|
|
+ a.uid = b.id left join business_glossory c on
|
|
|
+ a.business_glossory_id = c.id left join admin d on
|
|
|
+ a.aid = d.id
|
|
|
+ LEFT JOIN department_management dm on dm.id = d.department_id
|
|
|
+ where 1 = 1
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ and (b.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
|
|
|
+ </if>
|
|
|
+ <if test="uid != null and uid !=''">
|
|
|
+ and a.uid = #{uid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="businessGlossoryId !=null and businessGlossoryId != ''">
|
|
|
+ and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="identifyName != null and identifyName != ''">
|
|
|
+ and b.identify_name like concat('%', #{identifyName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="followSituation != null">
|
|
|
+ and a.follow_situation = #{followSituation,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="customerStatus != null">
|
|
|
+ and a.customer_status = #{customerStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="adminName != null and adminName != ''">
|
|
|
+ and d.name = #{adminName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectManagePersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
|
|
|
select
|
|
|
a.id as uid,
|
|
|
@@ -827,7 +915,7 @@
|
|
|
and a.identify_name like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="shareType != null">
|
|
|
- and a.share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
+ and a.share_type = #{shareType,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
and a.status = #{status,jdbcType=INTEGER}
|