Browse Source

客户统计新增一般客户,意向客户,重点客户统计

anderx 1 year ago
parent
commit
d772754610
1 changed files with 42 additions and 38 deletions
  1. 42 38
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

+ 42 - 38
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -103,25 +103,27 @@
 		left join district_glossory dg2 on b.city = dg2.id
 		left join district_glossory dg3 on b.area = dg3.id
 		left join industry_category c on b.industry = c.id
-		left join admin d on t0.aid = d.id where 1=1
-		<if test="name != null and name != ''">
-			and t0.identify_name like concat('%',#{name},'%')
-		</if>
-		<if test="startDate != null and startDate != ''">
-			and t0.transfer_time &gt; #{startDate}
-		</if>
-		<if test="endDate != null and endDate != ''">
-			and t0.transfer_time &lt; #{endDate}
-		</if>
-		<if test="province != null">
-			and b.province = #{province,jdbcType=INTEGER}
-		</if>
-		<if test="city != null">
-			and b.city = #{city,jdbcType=INTEGER}
-		</if>
-		<if test="area != null">
-			and b.area = #{area,jdbcType=INTEGER}
-		</if>
+		left join admin d on t0.aid = d.id
+		<where>
+			<if test="name != null and name != ''">
+				and t0.identify_name like concat('%',#{name},'%')
+			</if>
+			<if test="startDate != null and startDate != ''">
+				and t0.transfer_time &gt; #{startDate}
+			</if>
+			<if test="endDate != null and endDate != ''">
+				and t0.transfer_time &lt; #{endDate}
+			</if>
+			<if test="province != null">
+				and b.province = #{province,jdbcType=INTEGER}
+			</if>
+			<if test="city != null">
+				and b.city = #{city,jdbcType=INTEGER}
+			</if>
+			<if test="area != null">
+				and b.area = #{area,jdbcType=INTEGER}
+			</if>
+		</where>
 		 order by orderTime
 		 <if test="page_sql != null">
     		${page_sql}
@@ -131,25 +133,27 @@
 		select count(0)
 		from
 			(select id,aid,type,share_type,transfer_time,identify_name,society_tag from user where aid = #{aid} and type = 0 and share_type = 0 and status != 1)t0
-		left join user_identity b on t0.id = b.uid where 1=1
-		<if test="name != null and name != ''">
-			and t0.identify_name like concat('%',#{name},'%')
-		</if>
-		<if test="startDate != null and startDate != ''">
-			and t0.transfer_time &gt; #{startDate}
-		</if>
-		<if test="endDate != null and endDate != ''">
-			and t0.transfer_time &lt; #{endDate}
-		</if>
-		<if test="province != null">
-			and b.province = #{province,jdbcType=INTEGER}
-		</if>
-		<if test="city != null">
-			and b.city = #{city,jdbcType=INTEGER}
-		</if>
-		<if test="area != null">
-			and b.area = #{area,jdbcType=INTEGER}
-		</if>
+		left join user_identity b on t0.id = b.uid
+		 <where>
+			 <if test="name != null and name != ''">
+				 and t0.identify_name like concat('%',#{name},'%')
+			 </if>
+			 <if test="startDate != null and startDate != ''">
+				 and t0.transfer_time &gt; #{startDate}
+			 </if>
+			 <if test="endDate != null and endDate != ''">
+				 and t0.transfer_time &lt; #{endDate}
+			 </if>
+			 <if test="province != null">
+				 and b.province = #{province,jdbcType=INTEGER}
+			 </if>
+			 <if test="city != null">
+				 and b.city = #{city,jdbcType=INTEGER}
+			 </if>
+			 <if test="area != null">
+				 and b.area = #{area,jdbcType=INTEGER}
+			 </if>
+		 </where>
 	</select>
 	<select id="selectPublicPersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
 		select