|
@@ -618,20 +618,21 @@
|
|
|
|
|
|
|
|
<select id="listPublicStatistics" resultType="com.goafanti.weChat.bo.OutPublicStatistics">
|
|
<select id="listPublicStatistics" resultType="com.goafanti.weChat.bo.OutPublicStatistics">
|
|
|
select y.aid,y.bh,y.dk,y.wsh,y.tg,y.duration,c.name from(select x.aid ,sum(x.bh)bh,sum(x.wsh)wsh,sum(x.tg)tg,sum(x.dk)dk,sum(x.duration)duration
|
|
select y.aid,y.bh,y.dk,y.wsh,y.tg,y.duration,c.name from(select x.aid ,sum(x.bh)bh,sum(x.wsh)wsh,sum(x.tg)tg,sum(x.dk)dk,sum(x.duration)duration
|
|
|
- from (select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,if(a.clock_in=1,1,0) dk,a.aid
|
|
|
|
|
- ,if(a.status=2,a.duration,0)duration from public_release a left join admin b on a.aid=b.id
|
|
|
|
|
- where 1=1
|
|
|
|
|
|
|
+ from (select a.aid, if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,b.dk ,a.duration
|
|
|
|
|
+ from public_release a inner join (select prid ,sum(if(clock_in=1,1,0))dk from public_release_details where 1=1
|
|
|
|
|
+ <if test="clockStart != null and clockEnd != null">
|
|
|
|
|
+ and clock_in_time between #{clockStart} and #{clockEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ group by prid ) b on a.id =b.prid
|
|
|
|
|
+ left join admin c on a.aid=c.id where 1=1
|
|
|
<if test="aid != null">
|
|
<if test="aid != null">
|
|
|
and a.aid= #{aid}
|
|
and a.aid= #{aid}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="clockStart != null and clockEnd != null">
|
|
|
|
|
- and a.clock_in_time between #{clockStart} and #{clockEnd}
|
|
|
|
|
- </if>
|
|
|
|
|
<if test="createStart != null and createEnd !=null">
|
|
<if test="createStart != null and createEnd !=null">
|
|
|
and a.create_time between #{createStart} and #{createEnd}
|
|
and a.create_time between #{createStart} and #{createEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="depId != null">
|
|
<if test="depId != null">
|
|
|
- and b.department_id = #{depId}
|
|
|
|
|
|
|
+ and c.department_id = #{depId}
|
|
|
</if>
|
|
</if>
|
|
|
)x group by x.aid)y left join admin c on c.id=y.aid
|
|
)x group by x.aid)y left join admin c on c.id=y.aid
|
|
|
<if test="page_sql!=null">
|
|
<if test="page_sql!=null">
|
|
@@ -641,45 +642,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="countPublicStatistics" resultType="java.lang.Integer">
|
|
<select id="countPublicStatistics" resultType="java.lang.Integer">
|
|
|
- select count(*) from (select aid from public_release a left join admin b on a.aid=b.id
|
|
|
|
|
|
|
+ select count(*) from (select aid from public_release a
|
|
|
|
|
+ inner join (select prid ,sum(if(clock_in=1,1,0))dk from public_release_details where 1=1
|
|
|
|
|
+ <if test="clockStart != null and clockEnd != null">
|
|
|
|
|
+ and clock_in_time between #{clockStart} and #{clockEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ group by prid ) b on a.id =b.prid
|
|
|
|
|
+ left join admin c on a.aid=c.id
|
|
|
where 1=1
|
|
where 1=1
|
|
|
<if test="aid != null">
|
|
<if test="aid != null">
|
|
|
and a.aid= #{aid}
|
|
and a.aid= #{aid}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="clockStart != null and clockEnd != null">
|
|
|
|
|
- and a.clock_in_time between #{clockStart} and #{clockEnd}
|
|
|
|
|
- </if>
|
|
|
|
|
<if test="createStart != null and createEnd !=null">
|
|
<if test="createStart != null and createEnd !=null">
|
|
|
and a.create_time between #{createStart} and #{createEnd}
|
|
and a.create_time between #{createStart} and #{createEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="depId != null">
|
|
<if test="depId != null">
|
|
|
- and b.department_id = #{depId}
|
|
|
|
|
|
|
+ and c.department_id = #{depId}
|
|
|
</if>
|
|
</if>
|
|
|
group by aid)x
|
|
group by aid)x
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
|
|
<select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
|
|
|
- select a.id ,a.district_name districtName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,a.user_names userNames,
|
|
|
|
|
- date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn,a.remarks,a.supplement,a.type,
|
|
|
|
|
- date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.audit_info auditInfo,date_format(a.audit_time ,'%Y-%m-%d %H:%i:%S') auditTimes,
|
|
|
|
|
- d.name sname, date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,
|
|
|
|
|
- a.plan ,a.next_plan nextPlan ,a.expected_effect expectedEffect,a.update_status updateStatus,a.assist_aid_name assistAidName,
|
|
|
|
|
- a.main_name mainName,a.assist,a.assistant_aid assistantAid, a.assistant_name assistantName,e.contract_no contractNo,
|
|
|
|
|
- e.total_amount totalAmout
|
|
|
|
|
- from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
|
|
|
|
|
- left join admin d on b.aid=d.id left join t_order_new e on a.order_no =e.order_no
|
|
|
|
|
- <if test="uid != null">
|
|
|
|
|
- left join public_release_details prd on a.id=prd.prid
|
|
|
|
|
- </if>
|
|
|
|
|
|
|
+ select b.id,a.district_name districtName ,c.name aname,a.duration ,b.status ,b.annex_url annexUrl,a.photo_url photoUrl,d.nickname userName,
|
|
|
|
|
+ date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn ,b.remarks ,b.supplement ,b.`type` ,b.object_type ,
|
|
|
|
|
+ date_format(b.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,b.audit_info auditInfo,date_format(b.audit_time ,'%Y-%m-%d %H:%i:%S') auditTimes,
|
|
|
|
|
+ e.name sname, date_format(b.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(b.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,
|
|
|
|
|
+ b.plan ,b.next_plan nextPlan ,b.expected_effect expectedEffect,b.update_status updateStatus,b.assist_aid_name assistAidName,
|
|
|
|
|
+ b.main_name mainName,b.assist,b.assistant_aid assistantAid, b.assistant_name assistantName,f.contract_no contractNo,
|
|
|
|
|
+ f.total_amount totalAmout
|
|
|
|
|
+ from public_release_details a left join public_release b on a.prid =b.id
|
|
|
|
|
+ left join admin c on b.aid =c.id left join `user` d on a.uid =d.id left join admin e on d.aid=e.id
|
|
|
|
|
+ left join t_order_new f on b.order_no =f.order_no
|
|
|
where 1=1
|
|
where 1=1
|
|
|
<if test="publicType != null">
|
|
<if test="publicType != null">
|
|
|
- and a.type= #{publicType}
|
|
|
|
|
|
|
+ and b.type= #{publicType}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="aid != null">
|
|
<if test="aid != null">
|
|
|
- and a.aid= #{aid}
|
|
|
|
|
|
|
+ and b.aid= #{aid}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="sid != null">
|
|
<if test="sid != null">
|
|
|
- and d.id= #{sid}
|
|
|
|
|
|
|
+ and e.id= #{sid}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="deps !=null">
|
|
<if test="deps !=null">
|
|
|
and c.department_id in
|
|
and c.department_id in
|
|
@@ -688,21 +690,21 @@
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="uid != null">
|
|
<if test="uid != null">
|
|
|
- and prd.uid = #{uid}
|
|
|
|
|
|
|
+ and a.uid = #{uid}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="releaseStart != null and releaseEnd != null">
|
|
<if test="releaseStart != null and releaseEnd != null">
|
|
|
- and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
|
|
|
|
|
|
|
+ and (b.release_start between #{releaseStart} and #{releaseEnd} or b.release_end between #{releaseStart} and #{releaseEnd})
|
|
|
</if>
|
|
</if>
|
|
|
<if test="createStart != null and createEnd != null">
|
|
<if test="createStart != null and createEnd != null">
|
|
|
- and a.create_time between #{createStart} and #{createEnd}
|
|
|
|
|
|
|
+ and b.create_time between #{createStart} and #{createEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="status != null">
|
|
<if test="status != null">
|
|
|
- and a.status = #{status}
|
|
|
|
|
|
|
+ and b.status = #{status}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="clockIn !=null">
|
|
<if test="clockIn !=null">
|
|
|
and a.clock_in= #{clockIn}
|
|
and a.clock_in= #{clockIn}
|
|
|
</if>
|
|
</if>
|
|
|
- order by a.status,a.create_time desc
|
|
|
|
|
|
|
+ order by b.status,b.create_time desc
|
|
|
<if test="page_sql!=null">
|
|
<if test="page_sql!=null">
|
|
|
${page_sql}
|
|
${page_sql}
|
|
|
</if>
|
|
</if>
|
|
@@ -710,38 +712,38 @@
|
|
|
|
|
|
|
|
<select id="countPublicDtails" resultType="java.lang.Integer">
|
|
<select id="countPublicDtails" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
select count(*)
|
|
|
- from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
|
|
|
|
|
- left join admin d on b.aid=d.id
|
|
|
|
|
|
|
+ from public_release_details a left join public_release b on a.prid =b.id
|
|
|
|
|
+ left join admin c on b.aid =c.id left join `user` d on a.uid =d.id left join admin e on d.aid=e.id
|
|
|
<if test="uid != null">
|
|
<if test="uid != null">
|
|
|
left join public_release_details prd on a.id=prd.prid
|
|
left join public_release_details prd on a.id=prd.prid
|
|
|
</if>
|
|
</if>
|
|
|
where 1=1
|
|
where 1=1
|
|
|
<if test="publicType != null">
|
|
<if test="publicType != null">
|
|
|
- and a.type= #{publicType}
|
|
|
|
|
|
|
+ and b.type= #{publicType}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="aid != null">
|
|
<if test="aid != null">
|
|
|
- and a.aid= #{aid}
|
|
|
|
|
|
|
+ and b.aid= #{aid}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="sid != null">
|
|
<if test="sid != null">
|
|
|
- and d.id= #{sid}
|
|
|
|
|
|
|
+ and e.id= #{sid}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test=" deps !=null">
|
|
|
|
|
|
|
+ <if test="deps !=null">
|
|
|
and c.department_id in
|
|
and c.department_id in
|
|
|
<foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
<foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
#{dep}
|
|
#{dep}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="uid != null">
|
|
<if test="uid != null">
|
|
|
- and prd.uid = #{uid}
|
|
|
|
|
|
|
+ and a.uid = #{uid}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="releaseStart != null and releaseEnd != null">
|
|
<if test="releaseStart != null and releaseEnd != null">
|
|
|
- and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
|
|
|
|
|
|
|
+ and (b.release_start between #{releaseStart} and #{releaseEnd} or b.release_end between #{releaseStart} and #{releaseEnd})
|
|
|
</if>
|
|
</if>
|
|
|
<if test="createStart != null and createEnd != null">
|
|
<if test="createStart != null and createEnd != null">
|
|
|
- and a.create_time between #{createStart} and #{createEnd}
|
|
|
|
|
|
|
+ and b.create_time between #{createStart} and #{createEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="status != null">
|
|
<if test="status != null">
|
|
|
- and a.status = #{status}
|
|
|
|
|
|
|
+ and b.status = #{status}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="clockIn !=null">
|
|
<if test="clockIn !=null">
|
|
|
and a.clock_in= #{clockIn}
|
|
and a.clock_in= #{clockIn}
|