<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.ruoyi.system.mapper.RecordMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.system.model.Record">
|
<id column="id" property="id" />
|
<result column="record_type" property="recordType" />
|
<result column="create_time" property="createTime" />
|
<result column="deleted" property="deleted" />
|
<result column="name" property="name" />
|
<result column="update_time" property="updateTime" />
|
<result column="hierarchy_name" property="hierarchyName" />
|
<result column="hierarchy_names" property="hierarchyNames" />
|
<result column="remark" property="remark" />
|
<result column="level" property="level" />
|
<result column="number_factor_index" property="numberFactorIndex" />
|
<result column="problem_part" property="problemPart" />
|
<result column="reformed" property="reformed" />
|
<result column="scale_factor_index" property="scaleFactorIndex" />
|
<result column="specific_term_indexes" property="specificTermIndexes" />
|
<result column="suggestion" property="suggestion" />
|
<result column="hierarchy_path" property="hierarchyPath" />
|
<result column="content" property="content" />
|
<result column="creator_id" property="creatorId" />
|
<result column="check_task_id" property="checkTaskId" />
|
<result column="device_id" property="deviceId" />
|
<result column="problem_id" property="problemId" />
|
<result column="error_review_id" property="errorReviewId" />
|
<result column="responsible_person" property="responsiblePerson" />
|
</resultMap>
|
<select id="getHiddenDangerList" resultType="com.ruoyi.system.vo.HiddenDangerListVo">
|
|
select * from (
|
select t1.id,t1.hierarchy_name,t2.description,t1.problem_part problemPart,t1.remark,t1.level,t4.name planName,t1.problem_id problemId,
|
case
|
when t1.device_id is null then 1
|
else 2
|
end as type,
|
t1.create_time,t1.reformed,t1.responsible_person responsiblePerson,
|
case
|
when t5.id is null then 0
|
else t5.state
|
end as state
|
from record t1
|
left join problem t2 on t1.problem_id = t2.id
|
left join task t3 on t1.check_task_id = t3.id
|
left join plan t4 on t3.plan_id = t4.id
|
left join error_review t5 on t1.error_review_id = t5.id
|
where t1.deleted = 0 and t1.level is not null
|
and t1.check_task_id in
|
<foreach item="item" index="index" collection="taskIds" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
|
<if test="query.type == null">
|
and t1.level = 0
|
</if>
|
<if test="query.content != null">
|
and t1.hierarchy_name like concat('%',#{query.content},'%')
|
</if>
|
<if test="query.startTime != null and query.startTime !='' and query.endTime!=null and query.endTime !=''">
|
and t1.create_time between #{query.startTime} and #{query.endTime}
|
</if>
|
|
) as o where 1=1
|
<if test="query.type != null">
|
and o.type = #{query.type}
|
</if>
|
<if test="query.reformed != null">
|
and o.state = #{query.reformed}
|
</if>
|
order by o.create_time desc
|
</select>
|
|
<select id="getHiddenDangerDetail" resultType="com.ruoyi.system.vo.ProblemVo">
|
select specific_terms specificTermsStr,suggest_actions suggestActionsStr,number_factors numberFactorsStr
|
from problem
|
where id = #{problemId}
|
</select>
|
<select id="getErrorReview" resultType="com.ruoyi.system.model.ErrorReview">
|
select t1.id, t1.create_time,
|
t1.deleted,
|
t1.name,
|
t1.update_time,
|
t1.content,
|
t1.state,
|
t1.creator_id, t2.name creator
|
from error_review t1
|
left join user t2 on t1.creator_id = t2.id
|
where t1.id = #{errorReviewId}
|
|
</select>
|
<select id="findReviewImg" resultType="java.lang.String">
|
select CONCAT(t2.name, '.', t2.extension) from error_review_image t1
|
left join user_file t2 on t1.user_file_id = t2.id
|
where t1.error_review_id = #{errorReviewId}
|
</select>
|
<select id="getProjectName" resultType="java.lang.String">
|
select t2.name from task t1 left join project t2 on t1.project_id = t2.id
|
where t1.id = #{checkTaskId}
|
</select>
|
|
</mapper>
|