<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(r.create_time,'%Y-%m-%d')
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.create_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -83,8 +83,8 @@
and MONTH(DATE_SUB(r.create_time,INTERVAL -1 month))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and r.create_time>=DATE_SUB(beginTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)
and DATE_SUB(endTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)>=r.create_time
and DATE_FORMAT(r.create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.create_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -120,8 +120,8 @@
and MONTH(DATE_SUB(r.create_time,INTERVAL -1 year))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
@ -149,8 +149,8 @@
and MONTH(e.create_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(e.create_time,'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(e.create_time,'%Y-%m-%d')
and DATE_FORMAT(e.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(e.create_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -172,8 +172,32 @@
and MONTH(create_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(create_time,'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(create_time,'%Y-%m-%d')
and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(create_time,'%Y-%m-%d')
<iftest="userId != null and userId != '' ">and user_id=#{userId}
</if>
<iftest="bureauDeptId != null and bureauDeptId != '' ">and bureau_dept_id=#{bureauDeptId}</if>
<iftest="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(create_time)=#{year}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(create_time)=#{year}
and QUARTER(create_time)=#{quarter}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(create_time)=#{year}
and MONTH(create_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(create_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -203,8 +227,8 @@
and MONTH(c.complaint_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(c.complaint_time,'%Y-%m-%d')
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(c.complaint_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -234,8 +258,8 @@
and MONTH(n.create_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(n.create_time,'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(n.create_time,'%Y-%m-%d')
and DATE_FORMAT(n.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(n.create_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -265,8 +289,8 @@
and MONTH(DATE_SUB(n.create_time,INTERVAL -1 month))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and n.create_time>=DATE_SUB(beginTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)
and DATE_SUB(endTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)>=n.create_time
and DATE_FORMAT(n.create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime}),"%Y-%m-%d")+1 day)>=DATE_FORMAT(n.create_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -296,8 +320,8 @@
and MONTH(DATE_SUB(n.create_time,INTERVAL -1 year))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
@ -329,8 +353,8 @@
and MONTH(c.complaint_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(c.complaint_time,'%Y-%m-%d')
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime} ,'%Y-%m-%d')>= DATE_FORMAT(c.complaint_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -362,8 +386,8 @@
and MONTH(DATE_SUB(c.complaint_time,INTERVAL -1 month))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and c.complaint_time>=DATE_SUB(beginTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)
and DATE_SUB(endTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)>=c.complaint_time
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(c.complaint_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -395,8 +419,8 @@
and MONTH(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
@ -427,8 +451,8 @@
and MONTH(w.create_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(w.create_time,'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(w.create_time,'%Y-%m-%d')
and DATE_FORMAT(w.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(w.create_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -459,8 +483,8 @@
and MONTH(DATE_SUB(w.create_time,INTERVAL -1 month))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and w.create_time>=DATE_SUB(beginTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)
and DATE_SUB(endTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)>=w.create_time
and DATE_FORMAT(w.create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(w.create_time,'%Y-%m-%d')
</if>
</where>
</select>
@ -491,8 +515,8 @@
and MONTH(DATE_SUB(w.create_time,INTERVAL -1 year))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
@ -522,8 +546,8 @@
and MONTH(create_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(create_time,'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(create_time,'%Y-%m-%d')
and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(create_time,'%Y-%m-%d')
</if>
</where>
group by enterprise_number
@ -554,8 +578,8 @@
and MONTH(DATE_SUB(create_time,INTERVAL -1 month))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and create_time>=DATE_SUB(beginTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)
and DATE_SUB(endTime,INTERVAL TO_DAY(endTime)-TO_DAY(beginTime)+1 day)>=create_time
and DATE_FORMAT(create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime}),"%Y-%m-%d")+1 day)>=DATE_FORMAT(create_time,'%Y-%m-%d')
</if>
</where>
group by enterprise_number
@ -586,8 +610,8 @@
and MONTH(DATE_SUB(create_time,INTERVAL -1 year))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(create_time,INTERVAL -1 year),'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(DATE_SUB(create_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(DATE_SUB(create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
group by enterprise_number
@ -626,8 +650,8 @@
and MONTH(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') >= #{beginTime}
and #{endTime} >= DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d')