修饰审核--导出SQL优化
This commit is contained in:
parent
fa5bd277be
commit
36c42ccd8c
|
|
@ -81,7 +81,7 @@ public class RepairAuditDetailsController extends BaseController {
|
||||||
bean.setParams(params);
|
bean.setParams(params);
|
||||||
}
|
}
|
||||||
List<RepairAuditDetailsVO> list = repairAuditDetailsService.exportRepairQuestList(bean);
|
List<RepairAuditDetailsVO> list = repairAuditDetailsService.exportRepairQuestList(bean);
|
||||||
ExcelUtil<RepairAuditDetailsVO> util = new ExcelUtil<RepairAuditDetailsVO>(RepairAuditDetailsVO.class);
|
ExcelUtil<RepairAuditDetailsVO> util = new ExcelUtil<>(RepairAuditDetailsVO.class);
|
||||||
util.exportExcel(response, list, "修试审核任务列表");
|
util.exportExcel(response, list, "修试审核任务列表");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,23 +84,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="exportRepairQuestList" resultType="com.bonus.material.repair.domain.vo.RepairAuditDetailsVO">
|
<select id="exportRepairQuestList" resultType="com.bonus.material.repair.domain.vo.RepairAuditDetailsVO">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
tk.task_id taskId,
|
tk.task_id taskId,
|
||||||
tk.CODE scrapNum,
|
tk.CODE scrapNum,
|
||||||
tk.task_status taskStatus,
|
tk.task_status taskStatus,
|
||||||
bui.unit_name unitName,
|
bui.unit_name unitName,
|
||||||
bpl.pro_name projectName,
|
bpl.pro_name projectName,
|
||||||
su.nick_name createBy,
|
su.nick_name createBy,
|
||||||
tk.create_time createTime,
|
tk.create_time createTime,
|
||||||
tk.remark,
|
tk.remark,
|
||||||
tk.CODE repairNum,
|
tk.CODE repairNum,
|
||||||
mt1.type_name as type,
|
mt1.type_name as type,
|
||||||
mt.type_name as typeName,
|
mt.type_name as typeName,
|
||||||
mma.ma_code as maCode,
|
mma.ma_code as maCode,
|
||||||
rad.repair_num as repairNum2,
|
rad.repair_num as repairNum2,
|
||||||
rad.repaired_num as repairedNum2,
|
rad.repaired_num as repairedNum2,
|
||||||
rad.scrap_num as scrapNum2
|
rad.scrap_num as scrapNum2
|
||||||
FROM
|
FROM
|
||||||
tm_task tk
|
tm_task tk
|
||||||
LEFT JOIN tm_task_agreement tta ON tk.task_id = tta.task_id
|
LEFT JOIN tm_task_agreement tta ON tk.task_id = tta.task_id
|
||||||
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
|
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
|
||||||
LEFT JOIN bm_project bpl ON bai.project_id = bpl.pro_id
|
LEFT JOIN bm_project bpl ON bai.project_id = bpl.pro_id
|
||||||
|
|
@ -111,33 +111,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join ma_machine mma on rad.ma_id= mma.ma_id
|
left join ma_machine mma on rad.ma_id= mma.ma_id
|
||||||
LEFT JOIN sys_user su ON su.user_id = tk.create_by
|
LEFT JOIN sys_user su ON su.user_id = tk.create_by
|
||||||
WHERE
|
WHERE
|
||||||
tk.task_type = 45
|
tk.task_type = 45
|
||||||
<if test="keyword != null and keyword != ''">
|
<if test="keyword != null and keyword != ''">
|
||||||
AND (locate(#{keyword}, su.nick_name) > 0
|
AND (locate(#{keyword}, su.nick_name) > 0
|
||||||
or locate(#{keyword}, tk.CODE) > 0
|
or locate(#{keyword}, tk.CODE) > 0
|
||||||
or locate(#{keyword}, bui.unit_name) > 0
|
or locate(#{keyword}, bui.unit_name) > 0
|
||||||
or locate(#{keyword}, bpl.pro_name) > 0)
|
or locate(#{keyword}, bpl.pro_name) > 0)
|
||||||
</if>
|
</if>
|
||||||
<if test="backUnit != null and backUnit != ''">
|
<if test="backUnit != null and backUnit != ''">
|
||||||
and bui.unit_id = #{backUnit}
|
and bui.unit_id = #{backUnit}
|
||||||
</if>
|
</if>
|
||||||
<if test="taskStatus != null and taskStatus != ''">
|
<if test="taskStatus != null and taskStatus != ''">
|
||||||
and tk.task_status = #{taskStatus}
|
and tk.task_status = #{taskStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="backPro != null and backPro != ''">
|
<if test="backPro != null and backPro != ''">
|
||||||
and bpl.pro_id = #{backPro}
|
and bpl.pro_id = #{backPro}
|
||||||
</if>
|
</if>
|
||||||
<if test="type != null and type != ''">
|
<if test="type != null and type != ''">
|
||||||
and mt1.type_id = #{type}
|
and mt1.type_id = #{type}
|
||||||
</if>
|
</if>
|
||||||
<if test="backCode != null and backCode != ''">
|
<if test="backCode != null and backCode != ''">
|
||||||
and locate(#{backCode}, tk.code) > 0
|
and locate(#{backCode}, tk.code) > 0
|
||||||
</if>
|
</if>
|
||||||
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
|
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
|
||||||
and tk.create_time between #{params.beginTime} and #{params.endTime}
|
and tk.create_time between #{params.beginTime} and #{params.endTime}
|
||||||
</if>
|
</if>
|
||||||
ORDER BY
|
ORDER BY
|
||||||
tk.create_time DESC
|
tk.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRepairRecord" resultType="com.bonus.material.repair.domain.RepairRecord">
|
<select id="getRepairRecord" resultType="com.bonus.material.repair.domain.RepairRecord">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue