Commit e0e8635d authored by 李秀明's avatar 李秀明

fix(patrol): 巡检接口查询数据错误

parent d968c366
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.DateUtils; import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.config.PersonIdentify; import com.yeejoin.equipmanage.config.PersonIdentify;
...@@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -41,6 +45,9 @@ public class EmergencyController extends AbstractBaseController { ...@@ -41,6 +45,9 @@ public class EmergencyController extends AbstractBaseController {
@Autowired @Autowired
IEmergencyService iEmergencyService; IEmergencyService iEmergencyService;
@Autowired
RedisUtils redisUtils;
/** /**
* 通过bizOrgCode过滤 * 通过bizOrgCode过滤
*/ */
...@@ -48,8 +55,8 @@ public class EmergencyController extends AbstractBaseController { ...@@ -48,8 +55,8 @@ public class EmergencyController extends AbstractBaseController {
@ApiOperation("系统状态") @ApiOperation("系统状态")
@GetMapping(value = "/system/state") @GetMapping(value = "/system/state")
public ResponseModel getSystemState() { public ResponseModel getSystemState() {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode(); String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
return CommonResponseUtil.success(iEmergencyService.getSystemState(bizOrgCode)); return CommonResponseUtil.success(iEmergencyService.getSystemState(bizOrgCode));
} }
......
...@@ -99,10 +99,10 @@ public class CheckController extends AbstractBaseController { ...@@ -99,10 +99,10 @@ public class CheckController extends AbstractBaseController {
// //
// @Value("${file.port}") // @Value("${file.port}")
// private String filePort; // private String filePort;
// @Value("${file.url}") // @Value("${file.url}")
// private String fileUrl; // private String fileUrl;
@Value("${amosRefresh.patrol.topic}") @Value("${amosRefresh.patrol.topic}")
private String patrolTopic; private String patrolTopic;
@Autowired @Autowired
...@@ -137,7 +137,7 @@ public class CheckController extends AbstractBaseController { ...@@ -137,7 +137,7 @@ public class CheckController extends AbstractBaseController {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
param.setOrderBy("checkDate desc"); param.setOrderBy("checkDate desc");
param.setBizOrgCode(ObjectUtils.isEmpty(param.getBizOrgCode()) ? param.setBizOrgCode(ObjectUtils.isEmpty(param.getBizOrgCode()) ?
"3".equals(param.getIsOK()) ? null : reginParams.getPersonIdentity().getBizOrgCode() "3".equals(param.getIsOK()) ? null : reginParams.getPersonIdentity().getCompanyBizOrgCode()
: param.getBizOrgCode()); : param.getBizOrgCode());
if(commonPageable !=null){ if(commonPageable !=null){
param.setPageNumber(commonPageable.getPageNumber()-1); param.setPageNumber(commonPageable.getPageNumber()-1);
......
...@@ -43,6 +43,10 @@ public class ControlScreenController extends AbstractBaseController { ...@@ -43,6 +43,10 @@ public class ControlScreenController extends AbstractBaseController {
@RequestParam(required = false) String companyCode, @RequestParam(required = false) String companyCode,
@RequestParam(required = false) String bizOrgCode @RequestParam(required = false) String bizOrgCode
) { ) {
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
}
return CommonResponseUtil.success(iPlanTaskService.getStatics(companyCode, bizOrgCode)); return CommonResponseUtil.success(iPlanTaskService.getStatics(companyCode, bizOrgCode));
} }
......
...@@ -23,6 +23,8 @@ public interface CheckMapper extends BaseMapper { ...@@ -23,6 +23,8 @@ public interface CheckMapper extends BaseMapper {
long getCheckInfoCount(CheckInfoPageParam param); long getCheckInfoCount(CheckInfoPageParam param);
long getCheckInfoCountNew(CheckInfoPageParam param);
List<Map> queryUnqualifiedInputItem(@Param(value="checkId") int checkId); List<Map> queryUnqualifiedInputItem(@Param(value="checkId") int checkId);
List<Map> queryCheckPointInputItem(@Param(value="planTaskId") int planTaskId, @Param(value="pointId") int pointId); List<Map> queryCheckPointInputItem(@Param(value="planTaskId") int planTaskId, @Param(value="pointId") int pointId);
......
...@@ -159,7 +159,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -159,7 +159,7 @@ public class CheckServiceImpl implements ICheckService {
} }
public Page<CheckInfoVo> getCheckInfoNew(String toke,String product,String appKey,CheckInfoPageParam param) { public Page<CheckInfoVo> getCheckInfoNew(String toke,String product,String appKey,CheckInfoPageParam param) {
long total = checkMapper.getCheckInfoCount(param); long total = checkMapper.getCheckInfoCountNew(param);
List<CheckInfoVo> content = Lists.newArrayList(); List<CheckInfoVo> content = Lists.newArrayList();
if (total == 0) { if (total == 0) {
return new PageImpl<>(content, param, total); return new PageImpl<>(content, param, total);
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
<!--统计-记录统计 --> <!--统计-记录统计 -->
<select id="countCheckInfoData" resultType="long"> <select id="countCheckInfoData" resultType="long">
SELECT SELECT
count(1) AS total_num count(1) AS total_num
FROM FROM
`p_check` `a` `p_check` `a`
<choose> <choose>
<when test="pointName!=null or pointNo!=null or isFixed!=null or catalogId!=null"> <when test="pointName!=null or pointNo!=null or isFixed!=null or catalogId!=null">
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id` LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id`
...@@ -118,6 +118,55 @@ ...@@ -118,6 +118,55 @@
</trim> </trim>
</select> </select>
<select id="getCheckInfoCountNew" resultType="long">
SELECT
COUNT(1)
FROM
`p_check` `a`
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id`
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id`
LEFT JOIN wl_warehouse_structure wws on wws.id = b.risk_source_id
<if test="dangerId != null and dangerId != ''">
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id
</if>
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null and beginDate!= ''">and a.check_time &gt;= #{beginDate} </if>
<if test="endDate!=null and endDate!= ''">and a.check_time &lt;= #{endDate}</if>
<if test="userName!=null and userName!=''">and a.user_name like concat(concat("%",#{userName}),"%")</if>
<if test="pointName!=null and pointName!= ''">and b.name like concat(concat("%",#{pointName}),"%")</if>
<if test="pointNo!=null and pointNo!=''">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null and isFixed!=''">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if>
<if test="planId!=null and planId!='' ">and a.plan_Id = #{planId}</if>
<if test="planTaskId!=null and planTaskId!=''">and a.plan_task_id = #{planTaskId}</if>
<if test="userId!=null and userId!=''">and find_in_set(#{userId}, a.user_id) > 0</if>
<if test="routeId!=null and routeId!=''">and a.route_Id = #{routeId}</if>
<if test="catalogId!=null and catalogId!=''">and b.Catalog_Id = #{catalogId}</if>
<if test="orgCode!=null and orgCode!=''">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="pointId!=null and pointId!=''">and a.point_id = #{pointId}</if>
<if test="checkTime!=null and checkTime!=''">and TO_DAYS(a.check_time) = TO_DAYS('${checkTime}')</if>
<if test="departmentId!=null and departmentId!='-1'"> and find_in_set(#{departmentId}, a.dep_id) > 0</if>
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<choose>
<when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is null)</when>
<when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when>
<when test="finishStatus == 2">and `a`.`is_ok` = 3</when>
</choose>
<if test="dangerId != null and dangerId != ''">
and FIND_IN_SET(#{dangerId}, t.dangerIds)
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
<if test="searchDay != null and searchDay != ''">
and date_format(a.check_time, '%Y-%m-%d') = curdate()
</if>
<if test="isExecute!=null and isExecute!='' and isExecute == '3'">and a.is_OK != #{isExecute}</if>
</trim>
</select>
<select id="getCheckInfo" resultMap="checkInfoMap"> <select id="getCheckInfo" resultMap="checkInfoMap">
SELECT SELECT
a.id, a.id,
...@@ -209,85 +258,65 @@ ...@@ -209,85 +258,65 @@
<select id="getCheckInfoNew" resultMap="checkInfoMap"> <select id="getCheckInfoNew" resultMap="checkInfoMap">
SELECT SELECT
a.id, a.id,
a.org_code, a.org_code,
a.point_id pointId, a.point_id pointId,
a.point_name, a.point_name,
b.is_fixed, b.is_fixed,
b.point_no pointNo, b.point_no pointNo,
a.user_id, a.user_id,
a.user_name, a.user_name,
a.dep_name department_name, a.dep_name department_name,
a.dep_id departmentId, a.dep_id departmentId,
wws.name address, wws.name address,
date_format( date_format(`a`.`check_time`, '%Y-%m-%d %H:%i:%s') AS `checkDate`,
`a`.`check_time`, date_format(`a`.`upload_time`, '%Y-%m-%d %H:%i:%s') AS `upload_time`,
'%Y-%m-%d %H:%i:%s' (
) AS `checkDate`, CASE
date_format( WHEN `a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is null THEN '计划外完成'
`a`.`upload_time`, WHEN `a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3 THEN '按时完成'
'%Y-%m-%d %H:%i:%s' WHEN `a`.`is_ok` = 3 THEN '未执行'
) AS `upload_time`, END
( ) AS `Finish_Status`,
CASE (
WHEN `a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is null CASE
THEN '计划外完成' WHEN `a`.`is_ok` = 1 THEN '合格'
WHEN `a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3 WHEN `a`.`is_ok` = 2 THEN '不合格'
THEN '按时完成' WHEN `a`.`is_ok` = 3 THEN '漏检'
WHEN `a`.`is_ok` = 3 END
THEN '未执行' ) as is_ok,
END a.score,
) AS `Finish_Status`, a.`route_name`,
( (
CASE CASE
WHEN `a`.`is_ok` = 1 WHEN a.check_mode = 'QR' THEN '二维码巡检'
THEN '合格' WHEN a.check_mode = 'MOBILE' THEN '移动点巡检'
WHEN `a`.`is_ok` = 2 WHEN a.check_mode = 'NFC' THEN 'NFC巡检'
THEN '不合格' WHEN a.check_mode = 'WEB' THEN '录入检查点巡检'
WHEN `a`.`is_ok` = 3 WHEN a.check_mode = 'WEB_OUT' THEN '外来检查'
THEN '漏检' ELSE '系统自检'
END END
) as is_ok, ) as check_mode,
a.score, a.`plan_name` AS `plan_name`,
a.`route_name`, a.plan_task_id,
( a.plan_id,
CASE a.`route_id`,
WHEN a.check_mode = 'QR' b.`catalog_id`,
THEN '二维码巡检' a.error,
WHEN a.check_mode = 'MOBILE' a.remark,
THEN '移动点巡检' b.biz_org_name AS bizOrgName
WHEN a.check_mode = 'NFC'
THEN 'NFC巡检'
WHEN a.check_mode = 'WEB'
THEN '录入检查点巡检'
WHEN a.check_mode = 'WEB_OUT'
THEN '外来检查'
ELSE
'系统自检'
END
) as check_mode,
a.`plan_name` AS `plan_name`,
a.plan_task_id,
a.plan_id,
a.`route_id`,
b.`catalog_id`,
a.error,
a.remark,
b.biz_org_name AS bizOrgName
FROM FROM
`p_check` `a` `p_check` `a`
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id` LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id`
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id` LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id` LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id`
LEFT JOIN wl_warehouse_structure wws on wws.id = b.risk_source_id LEFT JOIN wl_warehouse_structure wws on wws.id = b.risk_source_id
<if test="dangerId != null and dangerId != ''"> <if test="dangerId != null and dangerId != ''">
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id
</if> </if>
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<!-- <if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if>--> <if test="beginDate!=null and beginDate!= ''">and a.check_time &gt;= #{beginDate} </if>
<if test="beginDate!=null and beginDate!= ''">and a.check_time >= #{beginDate} </if> <if test="endDate!=null and endDate!= ''">and a.check_time &lt;= #{endDate}</if>
<if test="endDate!=null and endDate!= ''">and #{endDate} >= a.check_time</if>
<!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> -->
<if test="userName!=null and userName!=''">and a.user_name like concat(concat("%",#{userName}),"%")</if> <if test="userName!=null and userName!=''">and a.user_name like concat(concat("%",#{userName}),"%")</if>
<if test="pointName!=null and pointName!= ''">and b.name like concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null and pointName!= ''">and b.name like concat(concat("%",#{pointName}),"%")</if>
<if test="pointNo!=null and pointNo!=''">and b.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null and pointNo!=''">and b.point_no like concat('%',#{pointNo},'%')</if>
...@@ -305,9 +334,7 @@ ...@@ -305,9 +334,7 @@
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if> <if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if> <if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<choose> <choose>
<when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is <when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is null)</when>
null)
</when>
<when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when> <when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when>
<when test="finishStatus == 2">and `a`.`is_ok` = 3</when> <when test="finishStatus == 2">and `a`.`is_ok` = 3</when>
</choose> </choose>
...@@ -318,17 +345,15 @@ ...@@ -318,17 +345,15 @@
and a.org_code LIKE CONCAT(#{bizOrgCode},'%') and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
</if> </if>
<if test="searchDay != null and searchDay != ''"> <if test="searchDay != null and searchDay != ''">
and date_format( and date_format(a.check_time, '%Y-%m-%d') = curdate()
a.check_time,
'%Y-%m-%d'
) = curdate()
</if> </if>
<if test="isExecute!=null and isExecute!='' and isExecute == '3'">and a.is_OK != #{isExecute}</if> <if test="isExecute!=null and isExecute!='' and isExecute == '3'">and a.is_OK != #{isExecute}</if>
</trim> </trim>
order by ${orderBy} order by
${orderBy}
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset}, #{pageSize}</when>
</choose> </choose>
</select> </select>
...@@ -2089,7 +2114,7 @@ ...@@ -2089,7 +2114,7 @@
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
......
...@@ -1359,91 +1359,103 @@ ...@@ -1359,91 +1359,103 @@
<select id="getStatics" resultType="java.util.Map"> <select id="getStatics" resultType="java.util.Map">
SELECT SELECT
'0' AS `key`, '0' AS `key`,
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`, ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'' AS unit, '' AS unit,
'今日总巡查点位' AS `name`, '今日总巡查点位' AS `name`,
'xfxcjrzxcdw' AS code 'xfxcjrzxcdw' AS code
FROM FROM
`p_plan_task` `p_plan_task`
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%') AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'1' AS `key`, '1' AS `key`,
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`, ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`,
'' AS unit, '' AS unit,
'今日累计巡查点位' AS `name`, '今日累计巡查点位' AS `name`,
'xfxcjrljxcdw' AS code 'xfxcjrljxcdw' AS code
FROM FROM
`p_plan_task` `p_plan_task`
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%') AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'2' AS `key`, '2' AS `key`,
count(1) AS `value`, count(1) AS `value`,
'' AS unit, '' AS unit,
'合格' AS `name`, '合格' AS `name`,
'xfxchg' AS code 'xfxchg' AS code
FROM FROM
`p_plan_task` ppk `p_plan_task` ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 1 DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 1
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%') AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'3' AS `key`, '3' AS `key`,
'' AS `value`, '' AS `value`,
'%' AS unit, '%' AS unit,
'合格占比' AS `name`, '合格占比' AS `name`,
'xfxchgzb' AS code 'xfxchgzb' AS code
UNION ALL UNION ALL
SELECT SELECT
'4' AS `key`, '4' AS `key`,
count(1) AS `value`, count(1) AS `value`,
'' AS unit, '' AS unit,
'不合格' AS `name`, '不合格' AS `name`,
'xfxcbhg' AS code 'xfxcbhg' AS code
FROM FROM
`p_plan_task` ppk `p_plan_task` ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 2 DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 2
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%') AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'5' AS `key`, '5' AS `key`,
count(1) AS `value`, count(1) AS `value`,
'' AS unit, '' AS unit,
'今日漏查点位' AS `name`, '今日漏查点位' AS `name`,
'xfxcjrlcdw' AS code 'xfxcjrlcdw' AS code
FROM FROM
`p_plan_task` `p_plan_task`
WHERE WHERE
`finish_status` = 3 `finish_status` = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%') AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'6' AS `key`, '6' AS `key`,
'' AS `value`, '' AS `value`,
'%' AS unit, '%' AS unit,
'漏查率' AS `name`, '漏查率' AS `name`,
'xfxclcl' AS code 'xfxclcl' AS code
</select> </select>
<select id="queryByCompanyCode" resultType="java.lang.String"> <select id="queryByCompanyCode" resultType="java.lang.String">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment