|
@@ -26,18 +26,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectPdmReportIllegalDayList" parameterType="PdmReportIllegalDay" resultMap="PdmReportIllegalDayResult">
|
|
|
- <include refid="selectPdmReportIllegalDayVo"/>
|
|
|
- <where>
|
|
|
- <if test="company != null and company != ''"> and company = #{company}</if>
|
|
|
- <if test="reportDate != null and reportDate != ''"> and report_date = #{reportDate}</if>
|
|
|
- <if test="provinceNum1 != null "> and province_num1 = #{provinceNum1}</if>
|
|
|
- <if test="provinceNum2 != null "> and province_num2 = #{provinceNum2}</if>
|
|
|
- <if test="cityNum1 != null "> and city_num1 = #{cityNum1}</if>
|
|
|
- <if test="cityNum2 != null "> and city_num2 = #{cityNum2}</if>
|
|
|
- <if test="countyNum1 != null "> and county_num1 = #{countyNum1}</if>
|
|
|
- <if test="countyNum2 != null "> and county_num2 = #{countyNum2}</if>
|
|
|
- <if test="checkNum != null "> and check_num = #{checkNum}</if>
|
|
|
- </where>
|
|
|
+ select * from (
|
|
|
+ <include refid="selectPdmReportIllegalDayVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="company != null and company != ''"> and company like concat('%', #{company}, '%')</if>
|
|
|
+ <if test="reportDate != null and reportDate != ''"> and report_date = #{reportDate}</if>
|
|
|
+ <if test="provinceNum1 != null "> and province_num1 = #{provinceNum1}</if>
|
|
|
+ <if test="provinceNum2 != null "> and province_num2 = #{provinceNum2}</if>
|
|
|
+ <if test="cityNum1 != null "> and city_num1 = #{cityNum1}</if>
|
|
|
+ <if test="cityNum2 != null "> and city_num2 = #{cityNum2}</if>
|
|
|
+ <if test="countyNum1 != null "> and county_num1 = #{countyNum1}</if>
|
|
|
+ <if test="countyNum2 != null "> and county_num2 = #{countyNum2}</if>
|
|
|
+ <if test="checkNum != null "> and check_num = #{checkNum}</if>
|
|
|
+ </where>
|
|
|
+ UNION
|
|
|
+ SELECT
|
|
|
+ sum(id) as id,
|
|
|
+ '总计' as company,
|
|
|
+ report_date,
|
|
|
+ sum(ifnull(province_num1,0)) province_num1,
|
|
|
+ sum(ifnull(province_num2,0)) province_num2,
|
|
|
+ sum(ifnull(city_num1,0)) city_num1,
|
|
|
+ sum(ifnull(city_num2,0)) city_num2,
|
|
|
+ sum(ifnull(county_num1,0)) county_num1,
|
|
|
+ sum(ifnull(county_num2,0)) county_num2,
|
|
|
+ sum(ifnull(check_num,0)) check_num,
|
|
|
+ create_by ,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time FROM
|
|
|
+ pdm_report_illegal_day
|
|
|
+ <where>
|
|
|
+ <if test="company != null and company != ''"> and company like concat('%', #{company}, '%')</if>
|
|
|
+ <if test="reportDate != null and reportDate != ''"> and report_date = #{reportDate}</if>
|
|
|
+ <if test="provinceNum1 != null "> and province_num1 = #{provinceNum1}</if>
|
|
|
+ <if test="provinceNum2 != null "> and province_num2 = #{provinceNum2}</if>
|
|
|
+ <if test="cityNum1 != null "> and city_num1 = #{cityNum1}</if>
|
|
|
+ <if test="cityNum2 != null "> and city_num2 = #{cityNum2}</if>
|
|
|
+ <if test="countyNum1 != null "> and county_num1 = #{countyNum1}</if>
|
|
|
+ <if test="countyNum2 != null "> and county_num2 = #{countyNum2}</if>
|
|
|
+ <if test="checkNum != null "> and check_num = #{checkNum}</if>
|
|
|
+ </where>) a order by id asc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPdmReportIllegalDayById" parameterType="Long" resultMap="PdmReportIllegalDayResult">
|