Commit 1771d2de authored by helinlin's avatar helinlin

增加防火监督检查记录照片查看

parent 0fe04b5e
...@@ -586,4 +586,14 @@ public class CheckController extends AbstractBaseController { ...@@ -586,4 +586,14 @@ public class CheckController extends AbstractBaseController {
return CommonResponseUtil.success(page); return CommonResponseUtil.success(page);
} }
/**
* 根据检查记录查询照片
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据检查记录查询照片", notes = "根据检查记录查询照片")
@RequestMapping(value = "/getPictureByCheckId", method = RequestMethod.GET)
public CommonResponse getPictureByCheckId(@ApiParam(value = "检查记录ID") @RequestParam String checkId) {
List<String> pictures = checkService.getPictureByCheckId(checkId);
return CommonResponseUtil.success(pictures);
}
} }
...@@ -295,4 +295,6 @@ public interface CheckMapper extends BaseMapper { ...@@ -295,4 +295,6 @@ public interface CheckMapper extends BaseMapper {
long queryPageCount(CheckPageParam param); long queryPageCount(CheckPageParam param);
List<CheckVo> queryPage(CheckPageParam param); List<CheckVo> queryPage(CheckPageParam param);
List<String> getPictureByCheckId(String checkId);
} }
...@@ -1577,7 +1577,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1577,7 +1577,7 @@ public class CheckServiceImpl implements ICheckService {
Plan plan = planService.queryPlanById(planTask.getPlanId()); Plan plan = planService.queryPlanById(planTask.getPlanId());
// 计划完成,规则推送消息 // 计划完成,规则推送消息
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){ if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()) {
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成); rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成);
} }
...@@ -1685,5 +1685,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1685,5 +1685,8 @@ public class CheckServiceImpl implements ICheckService {
return result; return result;
} }
@Override
public List<String> getPictureByCheckId(String checkId) {
return checkMapper.getPictureByCheckId(checkId);
}
} }
...@@ -282,4 +282,6 @@ public interface ICheckService { ...@@ -282,4 +282,6 @@ public interface ICheckService {
int checkHasRecord(Long planTaskId, Long pointId); int checkHasRecord(Long planTaskId, Long pointId);
Page<CheckVo> queryPage(CheckPageParam criterias); Page<CheckVo> queryPage(CheckPageParam criterias);
List<String> getPictureByCheckId(String checkId);
} }
...@@ -9,7 +9,10 @@ import java.util.Date; ...@@ -9,7 +9,10 @@ import java.util.Date;
*/ */
@Data @Data
public class CheckVo { public class CheckVo {
/**
* checkId
*/
private Long checkId;
/** /**
* 主键id * 主键id
*/ */
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if> <if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if>
<if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
<if test="departmentId!=null and departmentId!='-1'"> and find_in_set(#{departmentId}, a.dep_id) > 0</if> <if test="departmentId!=null and departmentId!='-1'">and find_in_set(#{departmentId}, a.dep_id) > 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) null)
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
THEN '2' THEN '2'
END END
) AS `Finish_Status`, ) AS `Finish_Status`,
a.is_ok is_ok, a.is_ok is_ok,
a.score, a.score,
d.`name` AS `route_name`, d.`name` AS `route_name`,
a.check_mode, a.check_mode,
...@@ -109,7 +109,8 @@ ...@@ -109,7 +109,8 @@
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`
<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 endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if>
...@@ -127,7 +128,7 @@ ...@@ -127,7 +128,7 @@
<if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
<if test="checkTime!=null">and TO_DAYS(a.check_time) = TO_DAYS('${checkTime}')</if> <if test="checkTime!=null">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="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 &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>
...@@ -211,7 +212,8 @@ ...@@ -211,7 +212,8 @@
order by ci.order_no order by ci.order_no
</select> </select>
<select id="findCheckPointInputItem" resultType="com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo" <select id="findCheckPointInputItem"
resultType="com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo"
parameterType="long"> parameterType="long">
SELECT SELECT
pp.id pointId, pp.id pointId,
...@@ -250,16 +252,16 @@ ...@@ -250,16 +252,16 @@
order by pci.order_no order by pci.order_no
</select> </select>
<!-- <select id="checkHasRecord" resultType="int">--> <!-- <select id="checkHasRecord" resultType="int">-->
<!-- SELECT--> <!-- SELECT-->
<!-- count(1) num--> <!-- count(1) num-->
<!-- FROM--> <!-- FROM-->
<!-- p_check c--> <!-- p_check c-->
<!-- WHERE--> <!-- WHERE-->
<!-- is_ok in (1,2)--> <!-- is_ok in (1,2)-->
<!-- and c.point_id = #{pointId}--> <!-- and c.point_id = #{pointId}-->
<!-- and c.plan_task_id = #{planTaskId}--> <!-- and c.plan_task_id = #{planTaskId}-->
<!-- </select>--> <!-- </select>-->
<select id="pieChartData" resultType="Map"> <select id="pieChartData" resultType="Map">
SELECT SELECT
...@@ -334,7 +336,7 @@ ...@@ -334,7 +336,7 @@
<if test="orgCode!=null">AND (c.org_code LIKE concat(#{orgCode},"-%") or c.org_code = #{orgCode})</if> <if test="orgCode!=null">AND (c.org_code LIKE concat(#{orgCode},"-%") or c.org_code = #{orgCode})</if>
<if test="departmentId!=null">AND FIND_IN_SET(#{departmentId}, c.dep_id) > 0</if> <if test="departmentId!=null">AND FIND_IN_SET(#{departmentId}, c.dep_id) > 0</if>
<if test="userId != null and userId != '' "> <if test="userId != null and userId != '' ">
AND FIND_IN_SET(#{userId}, c.user_id) > 0 AND FIND_IN_SET(#{userId}, c.user_id) > 0
</if> </if>
<if test="planId != null and planId != '' "> <if test="planId != null and planId != '' ">
AND c.plan_id = #{planId} AND c.plan_id = #{planId}
...@@ -475,7 +477,7 @@ ...@@ -475,7 +477,7 @@
<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>
<if test="departmentId!=null"> and find_in_set(#{departmentId},a.dep_id)>0 </if> <if test="departmentId!=null">and find_in_set(#{departmentId},a.dep_id)>0</if>
</trim> </trim>
</select> </select>
...@@ -658,12 +660,12 @@ ...@@ -658,12 +660,12 @@
sum(missed_check_num) forNum sum(missed_check_num) forNum
FROM FROM
p_plan_exec_statistics p_plan_exec_statistics
<where> <where>
<if test="orgCode!=null">AND LOCATE(#{orgCode}, org_Code) <![CDATA[>]]>0</if> <if test="orgCode!=null">AND LOCATE(#{orgCode}, org_Code) <![CDATA[>]]>0</if>
<if test="userId !=null">and user_id = #{userId}</if> <if test="userId !=null">and user_id = #{userId}</if>
AND check_time <![CDATA[>=]]> #{startDate} AND check_time <![CDATA[>=]]> #{startDate}
AND check_time <![CDATA[<=]]> #{endDate} AND check_time <![CDATA[<=]]> #{endDate}
</where> </where>
GROUP BY check_time GROUP BY check_time
) fa ) fa
...@@ -795,12 +797,13 @@ ...@@ -795,12 +797,13 @@
FROM FROM
p_point_classify classify p_point_classify classify
<where> <where>
classify.id IN ( SELECT pci.point_classify_id FROM p_check_input pci WHERE <if test="checkID != null">pci.check_id = #{checkID}</if> ) classify.id IN ( SELECT pci.point_classify_id FROM p_check_input pci WHERE <if test="checkID != null">
pci.check_id = #{checkID}
</if> )
</where> </where>
</select> </select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 --> <!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select id="getCheckInputByCheckId" resultMap="checkInputResultMap"> <select id="getCheckInputByCheckId" resultMap="checkInputResultMap">
SELECT SELECT
...@@ -831,32 +834,33 @@ ...@@ -831,32 +834,33 @@
LEFT JOIN p_input_item ii ON ci.input_id = ii.id LEFT JOIN p_input_item ii ON ci.input_id = ii.id
LEFT JOIN p_check c ON ci.check_id = c.id LEFT JOIN p_check c ON ci.check_id = c.id
<where> <where>
<if test="checkID != null"> <if test="checkID != null">
AND ci.check_id = #{checkID} AND ci.check_id = #{checkID}
</if> </if>
<if test="pointID != null"> <if test="pointID != null">
AND c.point_id = #{pointID} AND c.point_id = #{pointID}
</if> </if>
</where> </where>
</select> </select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 --> <!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select id="getCheckEquipByCheckID" resultType="java.util.HashMap" parameterType="java.lang.Long"> <select id="getCheckEquipByCheckID" resultType="java.util.HashMap" parameterType="java.lang.Long">
SELECT SELECT
classify.id as classifyId, classify.id as classifyId,
classify.name as equipmentName, classify.name as equipmentName,
classify.equipment_id as equipmentId, classify.equipment_id as equipmentId,
(SELECT create_date FROM p_check WHERE id = #{checkID}) as createDate (SELECT create_date FROM p_check WHERE id = #{checkID}) as createDate
FROM FROM
p_point_classify classify p_point_classify classify
WHERE WHERE
classify.id IN ( classify.id IN (
SELECT SELECT
pci.point_classify_id pci.point_classify_id
FROM p_check_input pci WHERE FROM p_check_input pci WHERE
<if test="pointID != null"> <if test="pointID != null">
pci.check_id = #{checkID} pci.check_id = #{checkID}
</if> ) </if>
)
</select> </select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 --> <!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select id="getEquipInputByCheckId" resultType="java.util.HashMap"> <select id="getEquipInputByCheckId" resultType="java.util.HashMap">
...@@ -899,7 +903,7 @@ ...@@ -899,7 +903,7 @@
AND c.point_id = #{pointID} AND c.point_id = #{pointID}
</if> </if>
<if test="classifyId != null"> <if test="classifyId != null">
AND ci.point_classify_id = #{classifyId} AND ci.point_classify_id = #{classifyId}
</if> </if>
</where> </where>
</select> </select>
...@@ -937,7 +941,7 @@ ...@@ -937,7 +941,7 @@
<!-- 根据巡检记录ID和巡检点ID获取巡检详情 --> <!-- 根据巡检记录ID和巡检点ID获取巡检详情 -->
<select id="getCheckDetailByID" resultMap="checkDetailResultMap"> <select id="getCheckDetailByID" resultMap="checkDetailResultMap">
SELECT SELECT
c.user_id AS userId, c.user_id AS userId,
c.dep_id AS depId, c.dep_id AS depId,
c.check_time AS CheckTime, c.check_time AS CheckTime,
...@@ -975,12 +979,12 @@ ...@@ -975,12 +979,12 @@
LEFT JOIN p_plan pl ON c.plan_id = pl.id LEFT JOIN p_plan pl ON c.plan_id = pl.id
LEFT JOIN p_route r ON r.id = c.route_id LEFT JOIN p_route r ON r.id = c.route_id
<where> <where>
<if test="checkID != null and checkID!= -1"> <if test="checkID != null and checkID!= -1">
AND c.id = #{checkID} AND c.id = #{checkID}
</if> </if>
<if test="pointID != null"> <if test="pointID != null">
AND c.point_id = #{pointID} AND c.point_id = #{pointID}
</if> </if>
</where> </where>
ORDER BY ORDER BY
c.check_time DESC c.check_time DESC
...@@ -1092,7 +1096,8 @@ ...@@ -1092,7 +1096,8 @@
<!-- 风险点最新巡检信息查询,3d屏使用 --> <!-- 风险点最新巡检信息查询,3d屏使用 -->
<resultMap id="planRoutePointResultMap" type="com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo"> <resultMap id="planRoutePointResultMap"
type="com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo">
<result property="routeName" column="route_name"/> <result property="routeName" column="route_name"/>
<result property="planName" column="plan_name"/> <result property="planName" column="plan_name"/>
<result property="deptName" column="department_name"/> <result property="deptName" column="department_name"/>
...@@ -1189,7 +1194,7 @@ ...@@ -1189,7 +1194,7 @@
) sa ) sa
<where> <where>
c.plan_id = sa.id c.plan_id = sa.id
<if test="userId != null">AND find_in_set(#{userId}, sa.user_id) >0 </if> <if test="userId != null">AND find_in_set(#{userId}, sa.user_id) >0</if>
<if test="checkDate != null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = DATE_FORMAT(#{checkDate}, '%Y%m%d') <if test="checkDate != null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = DATE_FORMAT(#{checkDate}, '%Y%m%d')
</if> </if>
</where> </where>
...@@ -1218,13 +1223,13 @@ ...@@ -1218,13 +1223,13 @@
a.route_id AS routeID, a.route_id AS routeID,
b.name AS name, b.name AS name,
(SELECT (SELECT
GROUP_CONCAT( GROUP_CONCAT(
`name` `name`
) )
FROM FROM
s_user u s_user u
WHERE WHERE
find_in_set(u.id,a.user_id)>0 ) AS realName, find_in_set(u.id,a.user_id)>0 ) AS realName,
a.id AS planID a.id AS planID
FROM FROM
p_plan a, p_plan a,
...@@ -1235,7 +1240,7 @@ ...@@ -1235,7 +1240,7 @@
) sa ) sa
WHERE WHERE
d.plan_id = sa.planID d.plan_id = sa.planID
<if test="userId != null">AND find_in_set(#{userId}, sa.userID)>0 </if> <if test="userId != null">AND find_in_set(#{userId}, sa.userID)>0</if>
<if test="checkDate != null">AND DATE_FORMAT(d.check_time, '%y%m%d') = #{checkDate}</if> <if test="checkDate != null">AND DATE_FORMAT(d.check_time, '%y%m%d') = #{checkDate}</if>
ORDER BY d.id DESC ORDER BY d.id DESC
) temp_row ) temp_row
...@@ -1523,7 +1528,7 @@ ...@@ -1523,7 +1528,7 @@
a.checkMonth a.checkMonth
</when> </when>
</choose> --> </choose> -->
select select
<choose> <choose>
<when test=" statisticsTyle == 0 "> <when test=" statisticsTyle == 0 ">
a.planName name, a.planName name,
...@@ -1571,7 +1576,7 @@ ...@@ -1571,7 +1576,7 @@
pt.id pointId, pt.id pointId,
c.user_id userName, c.user_id userName,
c.dep_id deptName, c.dep_id deptName,
c.user_id userId, c.user_id userId,
c.dep_id departmentId, c.dep_id departmentId,
c.score, c.score,
c.id checkId, c.id checkId,
...@@ -1612,7 +1617,7 @@ ...@@ -1612,7 +1617,7 @@
LEFT JOIN p_point pt ON c.point_id = pt.id LEFT JOIN p_point pt ON c.point_id = pt.id
WHERE 1=1 WHERE 1=1
<if test="orgCode!=null"> <if test="orgCode!=null">
and (c.org_code LIKE CONCAT( #{orgCode}, '-%' ) or c.org_code= #{orgCode} ) and (c.org_code LIKE CONCAT( #{orgCode}, '-%' ) or c.org_code= #{orgCode} )
</if> </if>
<choose> <choose>
<when test=" statisticsTyle == 1 "> <when test=" statisticsTyle == 1 ">
...@@ -1685,110 +1690,110 @@ ...@@ -1685,110 +1690,110 @@
ADDDATE(#{startTime} , INTERVAL @d DAY)<![CDATA[ < ]]> DATE_FORMAT(#{endTime}, '%Y-%m-%d') ADDDATE(#{startTime} , INTERVAL @d DAY)<![CDATA[ < ]]> DATE_FORMAT(#{endTime}, '%Y-%m-%d')
) d LEFT JOIN p_check c ON DATE_FORMAT(c.check_time, '%Y-%m-%d') = d.date ) d LEFT JOIN p_check c ON DATE_FORMAT(c.check_time, '%Y-%m-%d') = d.date
<if test=" orgCode != null and orgCode != '' ">and position( #{orgCode} in c.org_code )</if> <if test=" orgCode != null and orgCode != '' ">and position( #{orgCode} in c.org_code )</if>
<if test=" userId != null and userId != '' ">and find_in_set(#{userId}, c.user_id)>0 </if> <if test=" userId != null and userId != '' ">and find_in_set(#{userId}, c.user_id)>0</if>
<if test="type == 1">and c.is_ok != #{param}</if> <if test="type == 1">and c.is_ok != #{param}</if>
<if test="type == 2">and c.plan_id != #{param}</if> <if test="type == 2">and c.plan_id != #{param}</if>
<if test="type == 3">and c.is_ok = #{param}</if> <if test="type == 3">and c.is_ok = #{param}</if>
<where> <where>
<if test="startTime !=null and startTime!= '' "> <![CDATA[ AND d.date >= #{startTime} ]]> </if> <if test="startTime !=null and startTime!= '' "> <![CDATA[ AND d.date >= #{startTime} ]]> </if>
<if test="endTime !=null and endTime!='' "><![CDATA[AND d.date < #{endTime} ]]></if> <if test="endTime !=null and endTime!='' "><![CDATA[AND d.date < #{endTime} ]]></if>
</where> </where>
group by d.date group by d.date
order BY d.date order BY d.date
</select> </select>
<!-- 巡检记录查询 --> <!-- 巡检记录查询 -->
<!-- <select id="getCheckInfoList1" resultMap="CheckInfoResultMap">--> <!-- <select id="getCheckInfoList1" resultMap="CheckInfoResultMap">-->
<!-- select * from (--> <!-- select * from (-->
<!-- SELECT--> <!-- SELECT-->
<!-- DATE_FORMAT(c.check_time, '%Y-%m-%d %T') as checkTime,--> <!-- DATE_FORMAT(c.check_time, '%Y-%m-%d %T') as checkTime,-->
<!-- c.user_id as UserID,--> <!-- c.user_id as UserID,-->
<!-- c.point_id as PointID,--> <!-- c.point_id as PointID,-->
<!-- c.id as CheckID,--> <!-- c.id as CheckID,-->
<!-- c.is_ok as IsOK,--> <!-- c.is_ok as IsOK,-->
<!-- c.error as ErrorMsg,--> <!-- c.error as ErrorMsg,-->
<!-- c.plan_task_id as ErrorID,--> <!-- c.plan_task_id as ErrorID,-->
<!-- p.name as pointName,--> <!-- p.name as pointName,-->
<!-- c.dep_name as NAME,--> <!-- c.dep_name as NAME,-->
<!-- c.dep_id as GroupID,--> <!-- c.dep_id as GroupID,-->
<!-- c.user_name as RealName,--> <!-- c.user_name as RealName,-->
<!-- (SELECT--> <!-- (SELECT-->
<!-- GROUP_CONCAT(--> <!-- GROUP_CONCAT(-->
<!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone)--> <!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone)-->
<!-- )--> <!-- )-->
<!-- FROM--> <!-- FROM-->
<!-- s_user u--> <!-- s_user u-->
<!-- WHERE--> <!-- WHERE-->
<!-- find_in_set(u.id,c.user_id)>0) as LoginName,--> <!-- find_in_set(u.id,c.user_id)>0) as LoginName,-->
<!-- c.org_code as orgCode--> <!-- c.org_code as orgCode-->
<!-- FROM--> <!-- FROM-->
<!-- p_check c,--> <!-- p_check c,-->
<!-- p_point p--> <!-- p_point p-->
<!-- where--> <!-- where-->
<!-- p.id =c.point_id ) as a--> <!-- p.id =c.point_id ) as a-->
<!-- <trim prefix="WHERE" prefixOverrides="AND ">--> <!-- <trim prefix="WHERE" prefixOverrides="AND ">-->
<!-- <if test="pointID!=null">AND a.PointID = #{pointID}</if>--> <!-- <if test="pointID!=null">AND a.PointID = #{pointID}</if>-->
<!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>--> <!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>-->
<!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>--> <!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>-->
<!-- <if test="status!=null">AND a.IsOK = #{status}</if>--> <!-- <if test="status!=null">AND a.IsOK = #{status}</if>-->
<!-- <if test="userName!=null">AND a.RealName LIKE concat(concat("%",#{userName}),"%")</if>--> <!-- <if test="userName!=null">AND a.RealName LIKE concat(concat("%",#{userName}),"%")</if>-->
<!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>--> <!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>-->
<!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat("%",#{pointName}),"%")</if>--> <!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat("%",#{pointName}),"%")</if>-->
<!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>--> <!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>-->
<!-- </trim>--> <!-- </trim>-->
<!-- <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>!&ndash;&gt;--> <!-- </select>!&ndash;&gt;-->
<select id="getCheckInfoList1" resultType="Map"> <select id="getCheckInfoList1" resultType="Map">
select select
c.id as checkID, c.id as checkID,
c.dep_name as name, c.dep_name as name,
c.dep_id as groupID, c.dep_id as groupID,
c.user_name as realName, c.user_name as realName,
c.org_code as orgCode, c.org_code as orgCode,
c.user_id as userID, c.user_id as userID,
c.point_id as pointID, c.point_id as pointID,
c.is_ok as isOK, c.is_ok as isOK,
c.error as errorMsg, c.error as errorMsg,
c.plan_task_id as errorID, c.plan_task_id as errorID,
date_format(c.check_time, '%Y-%m-%d %T') as checkTime, date_format(c.check_time, '%Y-%m-%d %T') as checkTime,
p.name as pointName p.name as pointName
from from
p_check c, p_check c,
p_point p p_point p
where c.point_id = p.id where c.point_id = p.id
<if test="pointID!=null">AND c.point_id = #{pointID}</if> <if test="pointID!=null">AND c.point_id = #{pointID}</if>
<if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if> <if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if>
<if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if> <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0</if>
<if test="status!=null">AND c.is_ok = #{status}</if> <if test="status!=null">AND c.is_ok = #{status}</if>
<if test="userName!=null">AND c.error LIKE concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">AND c.error LIKE concat(concat("%",#{userName}),"%")</if>
<if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if> <if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if>
<if test="pointName!=null">AND p.name LIKE concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">AND p.name LIKE concat(concat("%",#{pointName}),"%")</if>
<if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if> <if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if>
order by c.create_date DESC order by c.create_date DESC
<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>
<!-- 巡检记录统计 --> <!-- 巡检记录统计 -->
<select id="countCheckInfoListData1" resultType="long"> <select id="countCheckInfoListData1" resultType="long">
select select
count(1) count(1)
from from
p_check c, p_check c,
p_point p p_point p
where c.point_id = p.id where c.point_id = p.id
<if test="pointID!=null">AND c.point_id = #{pointID}</if> <if test="pointID!=null">AND c.point_id = #{pointID}</if>
<if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if> <if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if>
<if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if> <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0</if>
<if test="status!=null">AND c.is_ok = #{status}</if> <if test="status!=null">AND c.is_ok = #{status}</if>
<if test="userName!=null">AND c.user_name LIKE concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">AND c.user_name LIKE concat(concat("%",#{userName}),"%")</if>
<if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if> <if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if>
...@@ -1883,11 +1888,11 @@ ...@@ -1883,11 +1888,11 @@
) d ) d
LEFT JOIN p_plan_task c ON DATE_FORMAT(c.check_date, '%Y-%m-%d') = d.date LEFT JOIN p_plan_task c ON DATE_FORMAT(c.check_date, '%Y-%m-%d') = d.date
<if test="orgCode !=null and orgCode!='' "> <if test="orgCode !=null and orgCode!='' ">
AND (c.org_code=#{orgCode} or c.org_code like CONCAT(#{orgCode},'-%')) AND (c.org_code=#{orgCode} or c.org_code like CONCAT(#{orgCode},'-%'))
</if> </if>
WHERE 1=1 WHERE 1=1
<if test="startTime !=null and startTime!= '' "> AND d.date <![CDATA[ >= ]]> #{startTime}</if> <if test="startTime !=null and startTime!= '' ">AND d.date <![CDATA[ >= ]]> #{startTime}</if>
<if test="endTime !=null and endTime!='' "> AND d.date <![CDATA[ < ]]> #{endTime} </if> <if test="endTime !=null and endTime!='' ">AND d.date <![CDATA[ < ]]> #{endTime}</if>
GROUP BY GROUP BY
d.date d.date
ORDER BY ORDER BY
...@@ -1896,22 +1901,22 @@ ...@@ -1896,22 +1901,22 @@
<select id="getItemCount" resultType="long"> <select id="getItemCount" resultType="long">
SELECT SELECT
count(1) count(1)
FROM FROM
p_input_item pii p_input_item pii
LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id
LEFT JOIN p_point pp ON ppi.point_id =pp.id LEFT JOIN p_point pp ON ppi.point_id =pp.id
WHERE WHERE
prp.route_id = #{routeId} prp.route_id = #{routeId}
<if test="pointId != null and pointId != '' and pointId != -1"> <if test="pointId != null and pointId != '' and pointId != -1">
AND ppi.point_id = #{pointId} AND ppi.point_id = #{pointId}
</if> </if>
<choose> <choose>
<when test="status != null and status != '' and status==0"> <when test="status != null and status != '' and status==0">
AND pci.id IS NULL AND pci.id IS NULL
</when> </when>
<when test="status != null and status != '' and status==1"> <when test="status != null and status != '' and status==1">
AND pci.id IS NOT NULL AND pci.id IS NOT NULL
...@@ -1924,43 +1929,43 @@ ...@@ -1924,43 +1929,43 @@
<select id="getCheckItems" resultType="Map"> <select id="getCheckItems" resultType="Map">
SELECT SELECT
ppi.id inputItemId, ppi.id inputItemId,
pii.name itemName, pii.name itemName,
pci.id IS NOT NULL finishStatus, pci.id IS NOT NULL finishStatus,
pci.safety_danger_num safetyNum, pci.safety_danger_num safetyNum,
pci.major_danger_num majorNum, pci.major_danger_num majorNum,
DATE_FORMAT(pci.create_date,'%Y-%m-%d %H:%i:%s') checkTime, DATE_FORMAT(pci.create_date,'%Y-%m-%d %H:%i:%s') checkTime,
pp.name companyName, pp.name companyName,
pci.user_name executeName pci.user_name executeName
FROM FROM
p_input_item pii p_input_item pii
LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id
LEFT JOIN p_point pp ON ppi.point_id =pp.id LEFT JOIN p_point pp ON ppi.point_id =pp.id
WHERE WHERE
prp.route_id = #{routeId} prp.route_id = #{routeId}
<if test="pointId != null and pointId != '' and pointId != -1"> <if test="pointId != null and pointId != '' and pointId != -1">
AND ppi.point_id = #{pointId} AND ppi.point_id = #{pointId}
</if> </if>
<choose> <choose>
<when test="status != null and status != '' and status==0"> <when test="status != null and status != '' and status==0">
AND pci.id IS NULL AND pci.id IS NULL
</when> </when>
<when test="status != null and status != '' and status==1"> <when test="status != null and status != '' and status==1">
AND pci.id IS NOT NULL AND pci.id IS NOT NULL
</when> </when>
</choose> </choose>
<if test="teamId != null and teamId != ''"> <if test="teamId != null and teamId != ''">
AND pp.original_id = #{teamId} AND pp.original_id = #{teamId}
</if> </if>
<!-- <if test="status != null and status != ''">--> <!-- <if test="status != null and status != ''">-->
<!-- AND pc.point_id = #{status}--> <!-- AND pc.point_id = #{status}-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="companyName != null and companyName != ''">--> <!-- <if test="companyName != null and companyName != ''">-->
<!-- AND pc.company_name = #{company_name}--> <!-- AND pc.company_name = #{company_name}-->
<!-- </if>--> <!-- </if>-->
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</select> </select>
...@@ -1983,12 +1988,12 @@ ...@@ -1983,12 +1988,12 @@
</select> </select>
<select id="queryPageCount" resultType="long"> <select id="queryPageCount" resultType="long">
SELECT SELECT
COUNT(1) COUNT(1)
FROM FROM
p_check c p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item i ON i.id = ci.input_id LEFT JOIN p_input_item i ON i.id = ci.input_id
LEFT JOIN p_point pp ON pp.id = c.point_id LEFT JOIN p_point pp ON pp.id = c.point_id
<where> <where>
<if test="planId != null"> <if test="planId != null">
c.plan_id = #{planId} c.plan_id = #{planId}
...@@ -1999,30 +2004,30 @@ ...@@ -1999,30 +2004,30 @@
<if test="pointId != null and pointId != -1"> <if test="pointId != null and pointId != -1">
AND pp.id = #{pointId} AND pp.id = #{pointId}
</if> </if>
<!-- <if test="orgCode != null">--> <!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}--> <!-- AND c.org_code = #{orgCode}-->
<!-- </if>--> <!-- </if>-->
</where> </where>
</select> </select>
<select id="queryPage" resultType="com.yeejoin.amos.supervision.business.vo.CheckVo"> <select id="queryPage" resultType="com.yeejoin.amos.supervision.business.vo.CheckVo">
SELECT SELECT
i.id, c.id checkId,
i.`name` inputItemName, i.id,
ci.safety_danger_num, i.`name` inputItemName,
ci.major_danger_num, ci.safety_danger_num,
ci.create_date checkTime, ci.major_danger_num,
ci.user_name, ci.create_date checkTime,
ci.accompany_user_name, ci.user_name,
pp.original_id, ci.accompany_user_name,
pp.name companyName, pp.original_id,
pp.name companyName,
IF IF
( c.check_time IS NULL, 0, 1 ) AS ext ( c.check_time IS NULL, 0, 1 ) AS ext
FROM FROM
p_check c p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item i ON i.id = ci.input_id LEFT JOIN p_input_item i ON i.id = ci.input_id
LEFT JOIN p_point pp ON pp.id = c.point_id LEFT JOIN p_point pp ON pp.id = c.point_id
<where> <where>
<if test="planId != null"> <if test="planId != null">
c.plan_id = #{planId} c.plan_id = #{planId}
...@@ -2033,9 +2038,9 @@ ...@@ -2033,9 +2038,9 @@
<if test="pointId != null and pointId != -1"> <if test="pointId != null and pointId != -1">
AND pp.id = #{pointId} AND pp.id = #{pointId}
</if> </if>
<!-- <if test="orgCode != null">--> <!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}--> <!-- AND c.org_code = #{orgCode}-->
<!-- </if>--> <!-- </if>-->
ORDER BY c.check_time DESC ORDER BY c.check_time DESC
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
...@@ -2043,4 +2048,13 @@ ...@@ -2043,4 +2048,13 @@
</choose> </choose>
</where> </where>
</select> </select>
<select id="getPictureByCheckId" resultType="java.lang.String">
SELECT
photo_data
FROM
p_check_shot
WHERE
check_id = #{checkId}
</select>
</mapper> </mapper>
\ No newline at end of file
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