安全违章

质量检查修改
This commit is contained in:
fl 2025-04-11 16:51:19 +08:00
parent 8abea9c774
commit 039ad034b4
4 changed files with 468 additions and 449 deletions

View File

@ -100,6 +100,7 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
} }
@Override @Override
@Transactional
public ServerResponse updateSafetyViolationById(SafetyViolationDto bean) { public ServerResponse updateSafetyViolationById(SafetyViolationDto bean) {
LoginUser loginUser = UserUtil.getLoginUser(); LoginUser loginUser = UserUtil.getLoginUser();
bean.setUpdateUserId(loginUser.getId()); bean.setUpdateUserId(loginUser.getId());

View File

@ -7,19 +7,19 @@
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">id,</if> <if test="id != null and id != ''">id,</if>
<if test="proId != null and proId != ''">pro_id,</if> <if test="proId != null and proId != ''">pro_id,</if>
<if test="proName != null">pro_name,</if> <if test="proName != null and proName != ''">pro_name,</if>
<if test="majorId != null and majorId != ''">major_id,</if> <if test="majorId != null and majorId != ''">major_id,</if>
<if test="majorName != null">major_name,</if> <if test="majorName != null and majorName != ''">major_name,</if>
<if test="gxId != null and gxId != ''">gx_id,</if> <if test="gxId != null and gxId != ''">gx_id,</if>
<if test="gxName != null">gx_name,</if> <if test="gxName != null and gxName != ''">gx_name,</if>
<if test="checkUserName != null">check_user_name,</if> <if test="checkUserName != null and checkUserName != ''">check_user_name,</if>
<if test="vioDate != null">vio_date,</if> <if test="vioDate != null and vioDate != ''">vio_date,</if>
<if test="vioPlace != null">vio_place,</if> <if test="vioPlace != null and vioPlace != ''" >vio_place,</if>
<if test="vioDesc != null">vio_desc,</if> <if test="vioDesc != null and vioDesc != ''" >vio_desc,</if>
<if test="rectDate != null">rect_date,</if> <if test="rectDate != null and rectDate != ''">rect_date,</if>
<if test="rectUserName != null">rect_user_name,</if> <if test="rectUserName != null and rectUserName != ''">rect_user_name,</if>
<if test="rectTime != null">rect_time,</if> <if test="rectTime != null and rectTime != ''">rect_time,</if>
<if test="rectDesc != null">rect_desc,</if> <if test="rectDesc != null and rectDesc != ''" >rect_desc,</if>
<if test="rectStatus != null">rect_status,</if> <if test="rectStatus != null">rect_status,</if>
<if test="buildBeforeDesc != null">build_before_desc,</if> <if test="buildBeforeDesc != null">build_before_desc,</if>
<if test="buildUnderDesc != null">build_under_desc,</if> <if test="buildUnderDesc != null">build_under_desc,</if>
@ -39,18 +39,18 @@
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if> <if test="id != null and id != ''">#{id},</if>
<if test="proId != null and proId != ''">#{proId},</if> <if test="proId != null and proId != ''">#{proId},</if>
<if test="proName != null">#{proName},</if> <if test="proName != null and proName != ''">#{proName},</if>
<if test="majorId != null and majorId != ''">#{majorId},</if> <if test="majorId != null and majorId != ''">#{majorId},</if>
<if test="majorName != null">#{majorName},</if> <if test="majorName != null and majorName != ''">#{majorName},</if>
<if test="gxId != null and gxId != ''">#{gxId},</if> <if test="gxId != null and gxId != ''">#{gxId},</if>
<if test="gxName != null and gxName != ''">#{gxName},</if> <if test="gxName != null and gxName != ''">#{gxName},</if>
<if test="checkUserName != null">#{checkUserName},</if> <if test="checkUserName != null and checkUserName != ''">#{checkUserName},</if>
<if test="vioDate != null and vioDate != ''">#{vioDate},</if> <if test="vioDate != null and vioDate != ''">#{vioDate},</if>
<if test="vioPlace != null">#{vioPlace},</if> <if test="vioPlace != null and vioPlace != ''">#{vioPlace},</if>
<if test="vioDesc != null">#{vioDesc},</if> <if test="vioDesc != null and vioDesc != ''">#{vioDesc},</if>
<if test="rectDate != null and rectDate != ''">#{rectDate},</if> <if test="rectDate != null and rectDate != ''">#{rectDate},</if>
<if test="rectUserName != null">#{rectUserName},</if> <if test="rectUserName != null and rectUserName != ''">#{rectUserName},</if>
<if test="rectTime != null">#{rectTime},</if> <if test="rectTime != null and rectTime != ''">#{rectTime},</if>
<if test="rectDesc != null and rectDesc != ''">#{rectDesc},</if> <if test="rectDesc != null and rectDesc != ''">#{rectDesc},</if>
<if test="rectStatus != null">#{rectStatus},</if> <if test="rectStatus != null">#{rectStatus},</if>
<if test="buildBeforeDesc != null">#{buildBeforeDesc},</if> <if test="buildBeforeDesc != null">#{buildBeforeDesc},</if>

View File

@ -1,191 +1,202 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.imgTool.imgUpload.dao.QualityInspectionDao"> <mapper namespace="com.bonus.imgTool.imgUpload.dao.QualityInspectionDao">
<insert id="insertQualityInspection" useGeneratedKeys="true" keyProperty="id" keyColumn="id"> <insert id="insertQualityInspection" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
INSERT INTO tb_quality_inspection INSERT INTO tb_quality_inspection
( (
pro_id, pro_id,
pro_name, pro_name,
major_id, major_id,
major_name, major_name,
gx_id, gx_id,
gx_name, gx_name,
check_user_name, check_user_name,
check_date, <if test="vioDate != null and vioDate !='' ">
check_place, check_date,
check_desc, </if>
rect_date, check_place,
rect_user_name, check_desc,
rect_time, <if test="rectDate != null and rectDate !='' ">
rect_desc, rect_date,
rect_status, </if>
data_source, rect_user_name,
create_user_id, <if test="rectTime != null and rectTime !='' ">
create_user_name, rect_time,
create_time </if>
)values ( rect_desc,
#{proId}, rect_status,
#{proName}, data_source,
#{majorId}, create_user_id,
#{majorName}, create_user_name,
#{gxId}, create_time
#{gxName}, )values (
#{checkUserName}, #{proId},
#{vioDate}, #{proName},
#{vioPlace}, #{majorId},
#{vioDesc}, #{majorName},
#{rectDate}, #{gxId},
#{rectUserName}, #{gxName},
#{rectTime}, #{checkUserName},
#{rectDesc}, <if test="vioDate != null and vioDate !='' ">
#{rectStatus}, #{vioDate},
#{dataSource}, </if>
#{createUserId}, #{vioPlace},
#{createUserName}, #{vioDesc},
#{createTime} <if test="rectDate != null and rectDate !='' ">
) #{rectDate},
</insert> </if>
#{rectUserName},
<if test="rectTime != null and rectTime !='' ">
#{rectTime},
</if>
#{rectDesc},
#{rectStatus},
#{dataSource},
#{createUserId},
#{createUserName},
#{createTime}
)
</insert>
<update id="updateQualityInspectionById"> <update id="updateQualityInspectionById">
UPDATE tb_quality_inspection UPDATE tb_quality_inspection
<set> <set>
<if test="proId != null"> <if test="proId != null">
pro_id = #{proId}, pro_id = #{proId},
</if> </if>
<if test="proName != null"> <if test="proName != null">
pro_name = #{proName}, pro_name = #{proName},
</if> </if>
<if test="majorId != null"> <if test="majorId != null">
major_id = #{majorId}, major_id = #{majorId},
</if> </if>
<if test="majorName != null"> <if test="majorName != null">
major_name = #{majorName}, major_name = #{majorName},
</if> </if>
<if test="gxId != null"> <if test="gxId != null">
gx_id = #{gxId}, gx_id = #{gxId},
</if> </if>
<if test="gxName != null"> <if test="gxName != null">
gx_name = #{gxName}, gx_name = #{gxName},
</if> </if>
<if test="checkUserName != null"> <if test="checkUserName != null">
check_user_name = #{checkUserName}, check_user_name = #{checkUserName},
</if> </if>
<if test="vioDate != null"> <if test="vioDate != null and vioDate != ''">
check_date = #{vioDate}, check_date = #{vioDate},
</if> </if>
<if test="vioPlace != null"> <if test="vioPlace != null">
check_place = #{vioPlace}, check_place = #{vioPlace},
</if> </if>
<if test="vioDesc != null"> <if test="vioDesc != null">
check_desc = #{vioDesc}, check_desc = #{vioDesc},
</if> </if>
<if test="rectDate != null"> <if test="rectDate != null and rectDate != ''">
rect_date = #{rectDate}, rect_date = #{rectDate},
</if> </if>
<if test="rectUserName != null"> <if test="rectUserName != null">
rect_user_name = #{rectUserName}, rect_user_name = #{rectUserName},
</if> </if>
<if test="rectTime != null"> <if test="rectTime != null and rectTime != ''">
rect_time = #{rectTime}, rect_time = #{rectTime},
</if> </if>
<if test="rectDesc != null"> <if test="rectDesc != null">
rect_desc = #{rectDesc}, rect_desc = #{rectDesc},
</if> </if>
<if test="rectStatus != null"> <if test="rectStatus != null">
rect_status = #{rectStatus}, rect_status = #{rectStatus},
</if> </if>
<if test="dataSource != null"> <if test="dataSource != null">
data_source = #{dataSource}, data_source = #{dataSource},
</if> </if>
<if test="updateUserId != null"> <if test="updateUserId != null">
update_user_id = #{updateUserId}, update_user_id = #{updateUserId},
</if> </if>
<if test="updateUserName != null"> <if test="updateUserName != null">
update_user_name = #{updateUserName} update_user_name = #{updateUserName}
</if> </if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>
<delete id="delQualityInspectionById"> <delete id="delQualityInspectionById">
update tb_quality_inspection set is_active = '0' update tb_quality_inspection
WHERE id = #{id} set is_active = '0'
</delete> WHERE id = #{id}
</delete>
<select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo"> <select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
SELECT SELECT
tsv.id, tsv.id,
tsv.pro_id, tsv.pro_id,
tsv.pro_name, tsv.pro_name,
tsv.major_id, tsv.major_id,
tsv.major_name, tsv.major_name,
tsv.gx_id, tsv.gx_id,
tsv.gx_name, tsv.gx_name,
tsv.check_user_name, tsv.check_user_name,
tsv.check_date as vioDate, tsv.check_date as vioDate,
tsv.check_place as vioPlace, tsv.check_place as vioPlace,
tsv.check_desc as vioDesc, tsv.check_desc as vioDesc,
tsv.rect_date, tsv.rect_date,
tsv.rect_user_name, tsv.rect_user_name,
tsv.rect_time, tsv.rect_time,
tsv.rect_desc, tsv.rect_desc,
tsv.rect_status, tsv.rect_status,
tsv.data_source, tsv.data_source,
count(DISTINCT sfr.id) as vioPhotoNum, count(DISTINCT sfr.id) as vioPhotoNum,
count(DISTINCT sfr2.id) as rectPhotoNum, count(DISTINCT sfr2.id) as rectPhotoNum,
group_concat(DISTINCT sfr.original_file_path) as vioPhoto, group_concat(DISTINCT sfr.original_file_path) as vioPhoto,
group_concat(DISTINCT sfr2.original_file_path) as rectPhoto group_concat(DISTINCT sfr2.original_file_path) as rectPhoto
FROM FROM
tb_quality_inspection tsv tb_quality_inspection tsv
LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id
AND sfr.source_type = '3' and sfr.is_active = '1' AND sfr.source_type = '3' and sfr.is_active = '1'
LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id
AND sfr2.source_type = '4' and sfr2.is_active = '1' AND sfr2.source_type = '4' and sfr2.is_active = '1'
left join tb_project tp on tp.id = tsv.pro_id and tp.is_active = '1' left join tb_project tp on tp.id = tsv.pro_id and tp.is_active = '1'
<where> <where>
tsv.is_active = '1' tsv.is_active = '1'
<if test="proId != null"> <if test="proId != null">
and tsv.pro_id = #{proId} and tsv.pro_id = #{proId}
</if> </if>
<if test="proType != null and proType != ''"> <if test="proType != null and proType != ''">
and tp.pro_type = #{proType} and tp.pro_type = #{proType}
</if> </if>
<if test="gxId != null"> <if test="gxId != null">
and tsv.gx_id = #{gxId} and tsv.gx_id = #{gxId}
</if> </if>
<if test="proStatus != null and proStatus != ''"> <if test="proStatus != null and proStatus != ''">
and tp.status = #{proStatus} and tp.status = #{proStatus}
</if> </if>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
and locate(#{keyWord},tsv.check_place) and locate(#{keyWord},tsv.check_place)
</if> </if>
</where> </where>
GROUP BY tsv.id GROUP BY tsv.id
</select> </select>
<select id="getQualityInspectionById" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo"> <select id="getQualityInspectionById" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
SELECT SELECT tsv.id,
tsv.id, tsv.pro_id,
tsv.pro_id, tsv.pro_name,
tsv.pro_name, tsv.major_id,
tsv.major_id, tsv.major_name,
tsv.major_name, tsv.gx_id,
tsv.gx_id, tsv.gx_name,
tsv.gx_name, tsv.check_user_name,
tsv.check_user_name, tsv.check_date as vioDate,
tsv.check_date as vioDate, tsv.check_place as vioPlace,
tsv.check_place as vioPlace, tsv.check_desc as vioDesc,
tsv.check_desc as vioDesc, tsv.rect_date,
tsv.rect_date, tsv.rect_user_name,
tsv.rect_user_name, tsv.rect_time,
tsv.rect_time, tsv.rect_desc,
tsv.rect_desc, tsv.rect_status,
tsv.rect_status, tsv.data_source
tsv.data_source FROM tb_quality_inspection tsv
FROM WHERE tsv.id = #{id}
tb_quality_inspection tsv </select>
WHERE tsv.id = #{id}
</select>
</mapper> </mapper>

View File

@ -1,264 +1,271 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.imgTool.imgUpload.dao.SafetyViolationDao"> <mapper namespace="com.bonus.imgTool.imgUpload.dao.SafetyViolationDao">
<insert id="insertSafetyViolation" useGeneratedKeys="true" keyProperty="id" keyColumn="id"> <insert id="insertSafetyViolation" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
INSERT INTO tb_safety_violations INSERT INTO tb_safety_violations
( (
pro_id, pro_id,
pro_name, pro_name,
major_id, major_id,
major_name, major_name,
gx_id, gx_id,
gx_name, gx_name,
check_user_name, check_user_name,
vio_date, <if test="vioDate != null and vioDate !='' ">
vio_place, vio_date,
vio_desc, </if>
rect_date, vio_place,
rect_user_name, vio_desc,
rect_time, <if test="rectDate != null and rectDate !='' ">
rect_desc, rect_date,
rect_status, </if>
data_source, rect_user_name,
create_user_id, <if test="rectTime != null and rectTime !='' ">
create_user_name, rect_time,
create_time </if>
)values ( rect_desc,
#{proId}, rect_status,
#{proName}, data_source,
#{majorId}, create_user_id,
#{majorName}, create_user_name
#{gxId}, )values (
#{gxName}, #{proId},
#{checkUserName}, #{proName},
#{vioDate}, #{majorId},
#{vioPlace}, #{majorName},
#{vioDesc}, #{gxId},
#{rectDate}, #{gxName},
#{rectUserName}, #{checkUserName},
#{rectTime}, <if test="vioDate != null and vioDate !='' ">
#{rectDesc}, #{vioDate},
#{rectStatus}, </if>
#{dataSource}, #{vioPlace},
#{createUserId}, #{vioDesc},
#{createUserName}, <if test="rectDate != null and rectDate !='' ">
#{createTime} #{rectDate},
) </if>
</insert> #{rectUserName},
<if test="rectTime != null and rectTime !='' ">
#{rectTime},
</if>
#{rectDesc},
#{rectStatus},
#{dataSource},
#{createUserId},
#{createUserName}
)
</insert>
<insert id="insertImgPhoto"> <insert id="insertImgPhoto">
INSERT INTO sys_file_resource INSERT INTO sys_file_resource
( (
file_name, file_name,
file_suffix, file_suffix,
file_size, file_size,
original_file_path, original_file_path,
compress_file_path, compress_file_path,
file_type, file_type,
source_id, source_id,
upload_type, upload_type,
source_type, source_type,
source_type_name, source_type_name,
create_user, create_user,
create_user_name create_user_name
)values )values
<foreach collection="fileList" item="item" separator=","> <foreach collection="fileList" item="item" separator=",">
( (
#{item.fileName}, #{item.fileName},
#{item.fileSuffix}, #{item.fileSuffix},
#{item.fileSize}, #{item.fileSize},
#{item.originalFilePath}, #{item.originalFilePath},
#{item.compressFilePath}, #{item.compressFilePath},
#{item.fileType}, #{item.fileType},
#{item.sourceId}, #{item.sourceId},
#{item.uploadType}, #{item.uploadType},
#{item.sourceType}, #{item.sourceType},
#{item.sourceTypeName}, #{item.sourceTypeName},
#{item.createUser}, #{item.createUser},
#{item.createUserName} #{item.createUserName}
) )
</foreach> </foreach>
</insert> </insert>
<update id="updateSafetyViolationById"> <update id="updateSafetyViolationById">
UPDATE tb_safety_violations UPDATE tb_safety_violations
<set> <set>
<if test="proId != null"> <if test="proId != null">
pro_id = #{proId}, pro_id = #{proId},
</if> </if>
<if test="proName != null"> <if test="proName != null">
pro_name = #{proName}, pro_name = #{proName},
</if> </if>
<if test="majorId != null"> <if test="majorId != null">
major_id = #{majorId}, major_id = #{majorId},
</if> </if>
<if test="majorName != null"> <if test="majorName != null">
major_name = #{majorName}, major_name = #{majorName},
</if> </if>
<if test="gxId != null"> <if test="gxId != null">
gx_id = #{gxId}, gx_id = #{gxId},
</if> </if>
<if test="gxName != null"> <if test="gxName != null">
gx_name = #{gxName}, gx_name = #{gxName},
</if> </if>
<if test="checkUserName != null"> <if test="checkUserName != null">
check_user_name = #{checkUserName}, check_user_name = #{checkUserName},
</if> </if>
<if test="vioDate != null"> <if test="vioDate != null and vioDate != ''">
vio_date = #{vioDate}, vio_date = #{vioDate},
</if> </if>
<if test="vioPlace != null"> <if test="vioPlace != null">
vio_place = #{vioPlace}, vio_place = #{vioPlace},
</if> </if>
<if test="vioDesc != null"> <if test="vioDesc != null">
vio_desc = #{vioDesc}, vio_desc = #{vioDesc},
</if> </if>
<if test="rectDate != null"> <if test="rectDate != null and rectDate != ''">
rect_date = #{rectDate}, rect_date = #{rectDate},
</if> </if>
<if test="rectUserName != null"> <if test="rectUserName != null">
rect_user_name = #{rectUserName}, rect_user_name = #{rectUserName},
</if> </if>
<if test="rectTime != null"> <if test="rectTime != null and rectTime != ''">
rect_time = #{rectTime}, rect_time = #{rectTime},
</if> </if>
<if test="rectDesc != null"> <if test="rectDesc != null">
rect_desc = #{rectDesc}, rect_desc = #{rectDesc},
</if> </if>
<if test="rectStatus != null"> <if test="rectStatus != null">
rect_status = #{rectStatus}, rect_status = #{rectStatus},
</if> </if>
<if test="dataSource != null"> <if test="dataSource != null">
data_source = #{dataSource}, data_source = #{dataSource},
</if> </if>
<if test="updateUserId != null"> <if test="updateUserId != null">
update_user_id = #{updateUserId}, update_user_id = #{updateUserId},
</if> </if>
<if test="updateUserName != null"> <if test="updateUserName != null">
update_user_name = #{updateUserName} update_user_name = #{updateUserName}
</if> </if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>
<delete id="delImgPhoto"> <delete id="delImgPhoto">
update sys_file_resource set is_active = '0' update sys_file_resource set is_active = '0'
WHERE WHERE
id IN id IN
<foreach collection="delFileList" item="item" separator="," open="(" close=")"> <foreach collection="delFileList" item="item" separator="," open="(" close=")">
#{item.id} #{item.id}
</foreach> </foreach>
</delete> </delete>
<delete id="delImgPhotoBySourceId"> <delete id="delImgPhotoBySourceId">
update sys_file_resource set is_active = '0' update sys_file_resource
WHERE set is_active = '0'
source_id = #{sourceId} WHERE source_id = #{sourceId}
AND upload_type = #{uploadType} AND upload_type = #{uploadType}
</delete> </delete>
<delete id="delSafetyViolationById"> <delete id="delSafetyViolationById">
update tb_safety_violations set is_active = '0' update tb_safety_violations
WHERE id = #{id} set is_active = '0'
</delete> WHERE id = #{id}
</delete>
<select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo"> <select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
SELECT SELECT
tsv.id, tsv.id,
tsv.pro_id, tsv.pro_id,
tsv.pro_name, tsv.pro_name,
tsv.major_id, tsv.major_id,
tsv.major_name, tsv.major_name,
tsv.gx_id, tsv.gx_id,
tsv.gx_name, tsv.gx_name,
tsv.check_user_name, tsv.check_user_name,
tsv.vio_date, tsv.vio_date,
tsv.vio_place, tsv.vio_place,
tsv.vio_desc, tsv.vio_desc,
tsv.rect_date, tsv.rect_date,
tsv.rect_user_name, tsv.rect_user_name,
tsv.rect_time, tsv.rect_time,
tsv.rect_desc, tsv.rect_desc,
tsv.rect_status, tsv.rect_status,
tsv.data_source, tsv.data_source,
count(DISTINCT sfr.id) as vioPhotoNum, count(DISTINCT sfr.id) as vioPhotoNum,
count(DISTINCT sfr2.id) as rectPhotoNum, count(DISTINCT sfr2.id) as rectPhotoNum,
group_concat(DISTINCT sfr.original_file_path) as vioPhoto, group_concat(DISTINCT sfr.original_file_path) as vioPhoto,
group_concat(DISTINCT sfr2.original_file_path) as rectPhoto group_concat(DISTINCT sfr2.original_file_path) as rectPhoto
FROM FROM
tb_safety_violations tsv tb_safety_violations tsv
LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id
AND sfr.source_type = '1' and sfr.is_active = '1' AND sfr.source_type = '1' and sfr.is_active = '1'
LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id
AND sfr2.source_type = '2' and sfr2.is_active = '1' AND sfr2.source_type = '2' and sfr2.is_active = '1'
left join tb_project tp on tp.id = tsv.pro_id and tp.is_active = '1' left join tb_project tp on tp.id = tsv.pro_id and tp.is_active = '1'
<where> <where>
tsv.is_active = '1' tsv.is_active = '1'
<if test="proId != null"> <if test="proId != null">
and tsv.pro_id = #{proId} and tsv.pro_id = #{proId}
</if> </if>
<if test="proType != null and proType != ''"> <if test="proType != null and proType != ''">
and tp.pro_type = #{proType} and tp.pro_type = #{proType}
</if> </if>
<if test="gxId != null"> <if test="gxId != null">
and tsv.gx_id = #{gxId} and tsv.gx_id = #{gxId}
</if> </if>
<if test="proStatus != null and proStatus != ''"> <if test="proStatus != null and proStatus != ''">
and tp.status = #{proStatus} and tp.status = #{proStatus}
</if> </if>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
and locate(#{keyWord},tsv.vio_place) and locate(#{keyWord},tsv.vio_place)
</if> </if>
</where> </where>
GROUP BY tsv.id GROUP BY tsv.id
</select> </select>
<select id="getSafetyViolationById" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo"> <select id="getSafetyViolationById" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
SELECT SELECT tsv.id,
tsv.id, tsv.pro_id,
tsv.pro_id, tsv.pro_name,
tsv.pro_name, tsv.major_id,
tsv.major_id, tsv.major_name,
tsv.major_name, tsv.gx_id,
tsv.gx_id, tsv.gx_name,
tsv.gx_name, tsv.check_user_name,
tsv.check_user_name, tsv.vio_date,
tsv.vio_date, tsv.vio_place,
tsv.vio_place, tsv.vio_desc,
tsv.vio_desc, tsv.rect_date,
tsv.rect_date, tsv.rect_user_name,
tsv.rect_user_name, tsv.rect_time,
tsv.rect_time, tsv.rect_desc,
tsv.rect_desc, tsv.rect_status,
tsv.rect_status, tsv.data_source
tsv.data_source FROM tb_safety_violations tsv
FROM WHERE tsv.id = #{id}
tb_safety_violations tsv </select>
WHERE tsv.id = #{id}
</select>
<select id="getImgPhotoList" resultType="com.bonus.imgTool.system.vo.dto.FileStorageDto"> <select id="getImgPhotoList" resultType="com.bonus.imgTool.system.vo.dto.FileStorageDto">
SELECT SELECT sfr.id,
sfr.id, sfr.file_name,
sfr.file_name, sfr.file_suffix,
sfr.file_suffix, sfr.file_size,
sfr.file_size, sfr.original_file_path,
sfr.original_file_path, sfr.compress_file_path,
sfr.compress_file_path, sfr.watermark_file_path,
sfr.watermark_file_path, sfr.file_type,
sfr.file_type, sfr.source_id,
sfr.source_id, sfr.upload_type,
sfr.upload_type, sfr.source_type,
sfr.source_type, sfr.source_type_name,
sfr.source_type_name, sfr.create_user,
sfr.create_user, sfr.create_user_name
sfr.create_user_name FROM sys_file_resource sfr
FROM WHERE sfr.source_id = #{sourceId}
sys_file_resource sfr AND sfr.source_type = #{sourceType}
WHERE sfr.source_id = #{sourceId} And sfr.is_active = '1'
AND sfr.source_type = #{sourceType} </select>
And sfr.is_active= '1'
</select>
</mapper> </mapper>