Kaynağa Gözat

修改SQL语句

wanghui 8 yıl önce
ebeveyn
işleme
5e90ba7ada

+ 4 - 4
src/main/java/com/goafanti/common/mapper/CustomerMapper.xml

@@ -414,10 +414,10 @@
     left join customer_organization_info d on a.id = d.cid
     left join admin e on a.aid = e.id 
     where a.effective = 0
-    <if test="aid != null">
+    <if test="aid != null and aid != ''">
     	and a.aid = #{aid,jdbcType=VARCHAR}
     </if>
-    <if test="paid != null">
+    <if test="paid != null and paid != ''">
     	or a.paid like concat('%',#{paid,jdbcType=VARCHAR},'%')
     </if>
     <if test="shareType != null">
@@ -441,13 +441,13 @@
     <if test="contactTel != null">
     	 and c.tel_num = #{contactTel,jdbcType=VARCHAR}
     </if>
-    <if test="companyName != null">
+    <if test="companyName != null and companyName != ''">
     	and d.company_name like concat('%',#{companyName,jdbcType=VARCHAR},'%')
     </if>
     <if test="locationProvince != null">
     	and d.location_province = #{locationProvince,jdbcType=VARCHAR}
     </if>
-   	<if test="adminName != null">
+   	<if test="adminName != null and adminName != ''">
    	 	and e.name like concat('%',#{adminName,jdbcType=VARCHAR},'%')
    	</if>
    	order by a.create_time desc

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

@@ -107,8 +107,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	@Override
 	public Pagination<CustomerOut> getTeamCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber) {
 		cin.setShareType("0");
-		String paid = findLadderIds(TokenManager.getAdminId());
-		cin.setPaid(paid);
+		cin.setPaid(TokenManager.getAdminId());
 		Map<String,Object> params = disposeParams(cin);
 		if(pageSize == null || pageSize < 0) pageSize = 10;
 		if(pageNumber == null || pageNumber <0 ) pageNumber = 1;