anderx 4 年之前
父節點
當前提交
8a722b1c16

+ 13 - 2
src/main/java/com/goafanti/common/mapper/RoleMapper.xml

@@ -20,11 +20,22 @@
     where id = #{id,jdbcType=VARCHAR}
   </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.Role">
-    insert into role (id, role_name,creater,create_time)
+    insert into role (id, role_name,creater,create_time
+    <if test="roleType!=null">
+    ,role_type
+    </if>
+    )
     values (#{id,jdbcType=VARCHAR}, #{roleName,jdbcType=VARCHAR},
-    		#{creater,jdbcType=VARCHAR},#{createTime,jdbcType=VARCHAR})
+    		#{creater,jdbcType=VARCHAR},#{createTime,jdbcType=VARCHAR}
+    		<if test="roleType!=null">
+    		,#{roleType}
+    		</if>
+    		)
     ON DUPLICATE KEY UPDATE
 	role_name = values(role_name)
+	<if test="roleType!=null">
+	,role_type=#{roleType}
+	</if>
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Role">
     insert into role

+ 7 - 24
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -2233,7 +2233,8 @@ inner join(
   
   <select id="selectChannelCountsList" resultType="com.goafanti.customer.bo.OutChannelCounts">
  	select b.name,b.id aid,a.counts,a.wfp unallocated,a.yfp allocated,a.yqd sign,a.ysf common
- 	from (select t1.aid,sum(tj)counts ,sum(t1.wfp)wfp,sum(t1.yfp)yfp,sum(t1.yqd)yqd,sum(t1.ysf)ysf from 
+ 	from admin b 
+ 	left join (select t1.aid,sum(tj)counts ,sum(t1.wfp)wfp,sum(t1.yfp)yfp,sum(t1.yqd)yqd,sum(t1.ysf)ysf from 
 	(select x.aid,x.uid,
 	if(x.status=8,0,1) tj,
 	case x.status  when 0 then 1 when 6 then 1 else 0 end as  wfp,
@@ -2251,33 +2252,15 @@ inner join(
 	<if test="type==2 and startTime !=null and endTime !=null">
 	and x.sign_time  between  #{startTime} and #{endTime}
 	</if>
-	)t1 group by t1.aid)a
-	left join admin b on a.aid=b.id
+	)t1 group by t1.aid)a  on a.aid=b.id left  join user_role ur on b.id=ur.uid 
+	left join `role` r on r.id=ur.rid where r.role_type=90
  	<if test="page_sql != null">
    		${page_sql}
 	</if>
   </select>
   <select id="selectChannelCountsCount" resultType="java.lang.Integer">
-    	select count(*)   
-  from 
-	(select t1.aid,sum(tj)counts ,sum(t1.wfp)wfp,sum(t1.yfp)yfp,sum(t1.yqd)yqd,sum(t1.ysf)ysf from 
-	(select x.aid,x.uid,
-	if(x.status=8,0,1) tj,
-	case x.status  when 0 then 1 when 6 then 1 else 0 end as  wfp,
-	case x.status  when 1 then 1 when 2 then 1 else 0 end as  yfp,
-	case x.status  when 7 then 1 else 0 end as  yqd,
-	case x.status  when 8 then 1 else 0 end as  ysf 
-	from user_channel x left join user y on x.uid =y.id
-	where 1=1 and x.status in (0,1,2,6,7,8)
-	<if test="type==0 and startTime !=null and endTime !=null">
-	and  x.create_time between  #{startTime} and #{endTime}
-	</if>
-	<if test="type==1 and startTime !=null and endTime !=null">
-	and x.distribution_time  between  #{startTime} and #{endTime} 
-	</if>
-	<if test="type==2 and startTime !=null and endTime !=null">
-	and x.sign_time  between  #{startTime} and #{endTime}
-	</if>
-	)t1 group by t1.aid)t2
+    		select count(*) from admin b left  join user_role ur on b.id=ur.uid 
+	left join `role` r on r.id=ur.rid 
+	where r.role_type=90
   </select>
 </mapper>

+ 15 - 0
src/main/java/com/goafanti/customer/bo/OutChannelCounts.java

@@ -16,12 +16,18 @@ public class OutChannelCounts {
 	}
 	
 	public Integer getUnallocated() {
+		if (unallocated==null) {
+			return 0;
+		}
 		return unallocated;
 	}
 	public void setUnallocated(Integer unallocated) {
 		this.unallocated = unallocated;
 	}
 	public Integer getAllocated() {
+		if (allocated==null) {
+			return 0;
+		}
 		return allocated;
 	}
 	public void setAllocated(Integer allocated) {
@@ -29,18 +35,27 @@ public class OutChannelCounts {
 	}
 
 	public Integer getSign() {
+		if (sign==null) {
+			return 0;
+		}
 		return sign;
 	}
 	public void setSign(Integer sign) {
 		this.sign = sign;
 	}
 	public Integer getCommon() {
+		if (common==null) {
+			return 0;
+		}
 		return common;
 	}
 	public void setCommon(Integer common) {
 		this.common = common;
 	}
 	public Integer getCounts() {
+		if (counts==null) {
+			return 0;
+		}
 		return counts;
 	}
 	public void setCounts(Integer counts) {