anderx před 6 roky
rodič
revize
acba6d57e0

+ 1 - 1
src/main/java/com/goafanti/admin/service/AdminService.java

@@ -82,5 +82,5 @@ public interface AdminService {
 
 	Pagination<AdminCustomerBo> selectAdminCustomerStatistics(String depId, String startTime, String endTime, Integer pageSize, Integer pageNo);
 
-	Pagination<AdminCustomerDetailBo> selectAdminCustomerList(String aid, String startTime, String endTime, Integer pageSize, Integer pageNo);
+	Pagination<AdminCustomerDetailBo> selectAdminCustomerList(String aid, String startTime, String endTime,Integer type, Integer pageSize, Integer pageNo);
 }

+ 2 - 1
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -372,12 +372,13 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<AdminCustomerDetailBo> selectAdminCustomerList(String aid, String startTime, String endTime,
+	public Pagination<AdminCustomerDetailBo> selectAdminCustomerList(String aid, String startTime, String endTime,Integer type,
 			Integer pageSize, Integer pageNo) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
 		if (StringUtils.isNotBlank(aid)) params.put("aid", aid);
+		if (type!=null) params.put("type", type);
 		if (StringUtils.isNotBlank(startTime)) params.put("startTime", startTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
 		return (Pagination<AdminCustomerDetailBo>)findPage("selectAdminCustomerDetailList", "selectAdminCustomerDetailCount", params, pageNo, pageSize);

+ 25 - 26
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -1051,7 +1051,7 @@
   </select>
   
   
-   <select id="selectAdminCustomerList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerBo">
+   <select id="selectAdminCustomerList"  resultType="com.goafanti.admin.bo.AdminCustomerBo">
   	select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as inputCount,
   	ifnull(c.timeCount,0) as receiveCount from admin a 
 	left join (select aid,count(aid) as userCount from user where aid is not null  
@@ -1083,23 +1083,7 @@
   </select>
   
   <select id="selectAdminCustomerCount" parameterType="java.lang.String" resultType="java.lang.Integer">
- select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as inputCount,
-  	ifnull(c.timeCount,0) as receiveCount from admin a 
-	left join (select aid,count(aid) as userCount from user where aid is not null  
-	and  share_type=0 and source !=0 and type=1
-	group by aid) b on a.id=b.aid
-	left join (select aid,count(aid) as timeCount from `user` where aid is not null  
-	and  share_type=0 and source =1 and type=1
-     <if test="startTime != null and endTime != null"> 
-    and  create_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-    </if>
-	group by aid) c on a.id=c.aid
-	left join (select aid,count(aid) as timeCount from `user` where aid is not null  
-	and  share_type=0 and source =2 and type=1
-	 <if test="startTime != null and endTime != null"> 
-    and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-    </if>
-	group by aid) d on a.id=c.aid
+ select count(*) from admin a 
 	left join department d on a.department_id=d.id
 	left join user_role e on a.id=e.uid
 	left join `role` f on e.rid=f.id
@@ -1110,20 +1094,29 @@
     </if>
   </select>
   
-   <select id="selectAdminCustomerDetailList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
+   <select id="selectAdminCustomerDetailList"  resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
   	select a.id,a.nickname as name,a.source,c.contacts,c.contact_mobile as contactMobile,
 	a.create_time as createTime,b.time_stamp as followTime
 	from user a 
 	left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b  on a.id=b.uid
 	left join organization_identity c on a.id=c.uid
-	where a.aid is not null
+	where a.aid is not null and  a.share_type=0 and a.type=1
 	<if test="aid != null"> 
 	and a.aid=  #{aid,jdbcType=VARCHAR}
     </if>
-	and  a.share_type=0 
-	and a.type=1
+    <if test="type==null">
+    and a.source !=4
+    </if>
+    <if test="type!=null and type == 0">
+    and a.source =1
+    and  a.create_time 
+    </if>
+    <if test="type!=null and type == 1">
+    and a.source =2
+    and  a.transfer_time 
+    </if>
 	<if test="startTime != null and endTime != null">
-	 and  a.create_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR} 
+	  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR} 
     </if>
    <if test="page_sql!=null">
 			${page_sql}
@@ -1134,12 +1127,18 @@
   	select count(*) from user a 
 	left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b  on a.id=b.uid
 	left join organization_identity c on a.id=c.uid
-	where a.aid is not null
+	where a.aid is not null and  a.share_type=0 and a.type=1
 	<if test="aid != null"> 
 	and a.aid=  #{aid,jdbcType=VARCHAR}
     </if>
-	and  a.share_type=0 
-	and a.type=1
+	<if test="type == null or type != 1">
+    and a.source !=0
+    and  a.create_time 
+    </if>
+    <if test="type!=null and type == 1">
+    and a.source =2
+    and  a.transfer_time 
+    </if>
 	<if test="startTime != null and endTime != null">
 	 and  a.create_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR} 
     </if>

+ 6 - 0
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -901,6 +901,9 @@
   	and o.finance_id is not null 
   	and o.finance_id != ''    
   	</if>
+  	<if test="o.departmentId != null and o.departmentId != &quot;&quot;">
+  	and o.order_dep= #{o.departmentId,jdbcType=VARCHAR}
+  	</if>
   	<if test="o.orderNo != null and o.orderNo != &quot;&quot;">
   	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
   	</if>
@@ -935,6 +938,9 @@
   	<if test="o.processStatus == 3">
   	and o.finance_id is not null and o.finance_id != ''    
   	</if>
+  	<if test="o.departmentId != null and o.departmentId != &quot;&quot;">
+  	and o.order_dep= #{o.departmentId,jdbcType=VARCHAR}
+  	</if>
   	<if test="o.orderNo != null and o.orderNo != &quot;&quot;">
   	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
   	</if>

+ 2 - 2
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -1133,9 +1133,9 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * @return
 	 */
 	@RequestMapping(value = "/selectAdminCustomerList", method = RequestMethod.GET)
-	public Result selectAdminCustomerList(String aid, String startTime,String endTime, Integer pageSize, Integer pageNo) {
+	public Result selectAdminCustomerList(String aid, String startTime,String endTime,Integer type, Integer pageSize, Integer pageNo) {
 		Result res = new Result();
-		res.data(adminService.selectAdminCustomerList( aid,  startTime, endTime,  pageSize,  pageNo));
+		res.data(adminService.selectAdminCustomerList( aid,  startTime, endTime,  type, pageSize,  pageNo));
 		return res;
 	}