Browse Source

单位客户查询新增筛选条件

anderx 7 years ago
parent
commit
69ae58364b

+ 9 - 0
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -342,6 +342,9 @@
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
+		<if test="departmentId != null and departmentId !=''">
+			and d.department_id=#{departmentId,jdbcType=VARCHAR}
+		</if>
 		<if test="name != null and name != ''">
 			and a.identify_name like concat('%',#{name},'%')
 		</if>
@@ -369,10 +372,16 @@
 			count(0)
 		from user a 
 		left join organization_identity b on a.id = b.uid
+		<if test="departmentId != null and departmentId !=''">
+		left join (select id
+		from admin 
+		where department_id=#{departmentId,jdbcType=VARCHAR}) d on a.aid = d.id
+		</if>
 		where a.type = 1 and a.status != 1
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
+		
 		<if test="name != null and name != ''">
 			and a.identify_name like concat('%',#{name},'%')
 		</if>

+ 10 - 0
src/main/java/com/goafanti/customer/bo/CustomerListIn.java

@@ -55,6 +55,8 @@ public class CustomerListIn {
 	
 	private Integer creditRating;
 	
+	private String departmentId;
+	
 	
 	public String getType() {
 		return type;
@@ -199,4 +201,12 @@ public class CustomerListIn {
 	public void setCreditRating(Integer creditRating) {
 		this.creditRating = creditRating;
 	}
+
+	public String getDepartmentId() {
+		return departmentId;
+	}
+
+	public void setDepartmentId(String departmentId) {
+		this.departmentId = departmentId;
+	}
 }

+ 1 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -189,6 +189,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		if(StringUtils.isNotBlank(cli.getEndDate())) params.put("endDate", cli.getEndDate());
 		if(StringUtils.isNotBlank(cli.getIndustry())) params.put("industry", Integer.parseInt(cli.getIndustry()));
 		if(StringUtils.isNotBlank(cli.getAid())) params.put("aid", cli.getAid());
+		if(StringUtils.isNotBlank(cli.getDepartmentId())) params.put("departmentId", cli.getDepartmentId());
 		if(StringUtils.isNotBlank(cli.getStatus())) params.put("status", Integer.parseInt(cli.getStatus()));
 		if(StringUtils.isNotBlank(cli.getSocietyTag())) params.put("societyTag", cli.getSocietyTag());
 		if(StringUtils.isNotBlank(cli.getStartDate())) params.put("startDate", cli.getStartDate()+" 00:00:00");