html += '<ddclass="check_label"onclick="changeArea(\''+datas[i].deptId+'\',\''+datas[i].deptName+'\')">'+datas[i].deptName+'<iclass="fa fa-angle-right"></i></dd>'
html += '<ddclass="check_label"onclick="changeArea(\''+datas[i].deptId+'\',\''+datas[i].deptName+'\',\'1\')">'+datas[i].deptName+'<iclass="fa fa-angle-right"></i></dd>'
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%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')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.create_time,'%Y-%m-%d')
</if>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -218,6 +222,10 @@
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_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')
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>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -270,6 +278,10 @@
and DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%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')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -355,6 +367,10 @@
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_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')
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>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -397,6 +413,10 @@
and DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%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')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -485,6 +505,10 @@
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_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')
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>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -528,6 +552,10 @@
and DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%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')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -608,6 +636,10 @@
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_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')
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>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -647,6 +679,10 @@
and DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%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')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -717,6 +753,10 @@
and DATE_FORMAT(e.create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{e.beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{e.endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{e.beginTime},"%Y-%m-%d"))+1 day)
and DATE_FORMAT(e.create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{e.beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{e.endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{e.beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{e.endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{e.endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{e.beginTime}),"%Y-%m-%d")+1 day)>=DATE_FORMAT(e.create_time,'%Y-%m-%d')
and DATE_SUB(STR_TO_DATE(#{e.endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{e.endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{e.beginTime}),"%Y-%m-%d")+1 day)>=DATE_FORMAT(e.create_time,'%Y-%m-%d')
</if>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -753,6 +793,10 @@
and DATE_FORMAT(DATE_SUB(e.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(DATE_SUB(e.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(e.create_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(e.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<iftest="dateType != null and dateType != 'day' and beginTime != null and beginTime != '' and endTime != null and endTime != ''">
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>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -789,21 +833,28 @@
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
</if>
</if>
<iftest="dateType != null and dateType != '' and dateType == 'year' ">
<iftest="beginTime != null and beginTime != ''">
and YEAR(r.create_time)=#{year}
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >=#{beginTime}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(r.create_time)=#{year}
and QUARTER(r.create_time)=#{quarter}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(r.create_time)=#{year}
and MONTH(r.create_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
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>
</if>
<iftest="endTime != null and endTime != ''">
and DATE_FORMAT(r.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{endTime}
</if>
<!-- <if test="dateType != null and dateType != '' and dateType == 'year' ">-->
<!-- and YEAR(r.create_time)=#{year}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'quarter' ">-->
<!-- and YEAR(r.create_time)=#{year}-->
<!-- and QUARTER(r.create_time)=#{quarter}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'month' ">-->
<!-- and YEAR(r.create_time)=#{year}-->
<!-- and MONTH(r.create_time)=#{month}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'day' ">-->
<!-- 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>-->
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -831,21 +882,27 @@
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
</if>
</if>
<iftest="dateType != null and dateType != '' and dateType == 'year' ">
<iftest="beginTime != null and beginTime != ''">
and YEAR(c.complaint_time)=#{year}
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >=#{beginTime}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(c.complaint_time)=#{year}
and QUARTER(c.complaint_time)=#{quarter}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(c.complaint_time)=#{year}
and MONTH(c.complaint_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
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>
</if>
<iftest="endTime != null and endTime != ''">
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{endTime}
</if>
<!-- <if test="dateType != null and dateType != '' and dateType == 'year' ">-->
<!-- and YEAR(c.complaint_time)=#{year}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'quarter' ">-->
<!-- and YEAR(c.complaint_time)=#{year}-->
<!-- and QUARTER(c.complaint_time)=#{quarter}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'month' ">-->
<!-- and YEAR(c.complaint_time)=#{year}-->
<!-- and MONTH(c.complaint_time)=#{month}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'day' ">-->
<!-- 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>-->
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -881,21 +938,27 @@
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
</if>
</if>
<iftest="dateType != null and dateType != '' and dateType == 'year' ">
<iftest="beginTime != null and beginTime != ''">
and YEAR(r.create_time)=#{year}
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >=#{beginTime}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(r.create_time)=#{year}
and QUARTER(r.create_time)=#{quarter}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(r.create_time)=#{year}
and MONTH(r.create_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
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>
</if>
<iftest="endTime != null and endTime != ''">
and DATE_FORMAT(r.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{endTime}
</if>
<!-- <if test="dateType != null and dateType != '' and dateType == 'year' ">-->
<!-- and YEAR(r.create_time)=#{year}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'quarter' ">-->
<!-- and YEAR(r.create_time)=#{year}-->
<!-- and QUARTER(r.create_time)=#{quarter}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'month' ">-->
<!-- and YEAR(r.create_time)=#{year}-->
<!-- and MONTH(r.create_time)=#{month}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'day' ">-->
<!-- 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>-->
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -936,21 +999,27 @@
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
</if>
</if>
<iftest="dateType != null and dateType != '' and dateType == 'year' ">
<iftest="beginTime != null and beginTime != ''">
and YEAR(r.create_time)=#{year}
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >=#{beginTime}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(r.create_time)=#{year}
and QUARTER(r.create_time)=#{quarter}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(r.create_time)=#{year}
and MONTH(r.create_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
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>
</if>
<iftest="endTime != null and endTime != ''">
and DATE_FORMAT(r.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{endTime}
</if>
<!-- <if test="dateType != null and dateType != '' and dateType == 'year' ">-->
<!-- and YEAR(r.create_time)=#{year}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'quarter' ">-->
<!-- and YEAR(r.create_time)=#{year}-->
<!-- and QUARTER(r.create_time)=#{quarter}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'month' ">-->
<!-- and YEAR(r.create_time)=#{year}-->
<!-- and MONTH(r.create_time)=#{month}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'day' ">-->
<!-- 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>-->
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
${params.dataScope}
@ -991,20 +1060,26 @@
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
</if>
</if>
<iftest="dateType != null and dateType != '' and dateType == 'year' ">
<!-- <if test="dateType != null and dateType != '' and dateType == 'year' ">-->
and YEAR(r.create_time)=#{year}
<!-- and YEAR(r.create_time)=#{year}-->
</if>
<!-- </if>-->
<iftest="dateType != null and dateType != '' and dateType == 'quarter' ">
<!-- <if test="dateType != null and dateType != '' and dateType == 'quarter' ">-->
and YEAR(r.create_time)=#{year}
<!-- and YEAR(r.create_time)=#{year}-->
and QUARTER(r.create_time)=#{quarter}
<!-- and QUARTER(r.create_time)=#{quarter}-->
</if>
<!-- </if>-->
<iftest="dateType != null and dateType != '' and dateType == 'month' ">
<!-- <if test="dateType != null and dateType != '' and dateType == 'month' ">-->
and YEAR(r.create_time)=#{year}
<!-- and YEAR(r.create_time)=#{year}-->
and MONTH(r.create_time)=#{month}
<!-- and MONTH(r.create_time)=#{month}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'day' ">-->
<!-- 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>-->
<iftest="beginTime != null and beginTime != ''">
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >=#{beginTime}
</if>
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
<iftest="endTime != null and endTime != ''">
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(r.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{endTime}
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.create_time,'%Y-%m-%d')
</if>
</if>
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">
@ -1036,21 +1111,27 @@
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
</if>
</if>
<iftest="dateType != null and dateType != '' and dateType == 'year' ">
<iftest="beginTime != null and beginTime != ''">
and YEAR(c.complaint_time)=#{year}
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >=#{beginTime}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(c.complaint_time)=#{year}
and QUARTER(c.complaint_time)=#{quarter}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(c.complaint_time)=#{year}
and MONTH(c.complaint_time)=#{month}
</if>
<iftest="dateType != null and dateType != '' and dateType == 'day' ">
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>
</if>
<iftest="endTime != null and endTime != ''">
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{endTime}
</if>
<!-- <if test="dateType != null and dateType != '' and dateType == 'year' ">-->
<!-- and YEAR(c.complaint_time)=#{year}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'quarter' ">-->
<!-- and YEAR(c.complaint_time)=#{year}-->
<!-- and QUARTER(c.complaint_time)=#{quarter}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'month' ">-->
<!-- and YEAR(c.complaint_time)=#{year}-->
<!-- and MONTH(c.complaint_time)=#{month}-->
<!-- </if>-->
<!-- <if test="dateType != null and dateType != '' and dateType == 'day' ">-->
<!-- 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>-->
<!-- 数据范围过滤 -->
<!-- 数据范围过滤 -->
<iftest="params.dataScope != null and params.dataScope != ''">
<iftest="params.dataScope != null and params.dataScope != ''">