parent
8abea9c774
commit
039ad034b4
|
|
@ -100,6 +100,7 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ServerResponse updateSafetyViolationById(SafetyViolationDto bean) {
|
||||
LoginUser loginUser = UserUtil.getLoginUser();
|
||||
bean.setUpdateUserId(loginUser.getId());
|
||||
|
|
|
|||
|
|
@ -7,19 +7,19 @@
|
|||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">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="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="gxName != null">gx_name,</if>
|
||||
<if test="checkUserName != null">check_user_name,</if>
|
||||
<if test="vioDate != null">vio_date,</if>
|
||||
<if test="vioPlace != null">vio_place,</if>
|
||||
<if test="vioDesc != null">vio_desc,</if>
|
||||
<if test="rectDate != null">rect_date,</if>
|
||||
<if test="rectUserName != null">rect_user_name,</if>
|
||||
<if test="rectTime != null">rect_time,</if>
|
||||
<if test="rectDesc != null">rect_desc,</if>
|
||||
<if test="gxName != null and gxName != ''">gx_name,</if>
|
||||
<if test="checkUserName != null and checkUserName != ''">check_user_name,</if>
|
||||
<if test="vioDate != null and vioDate != ''">vio_date,</if>
|
||||
<if test="vioPlace != null and vioPlace != ''" >vio_place,</if>
|
||||
<if test="vioDesc != null and vioDesc != ''" >vio_desc,</if>
|
||||
<if test="rectDate != null and rectDate != ''">rect_date,</if>
|
||||
<if test="rectUserName != null and rectUserName != ''">rect_user_name,</if>
|
||||
<if test="rectTime != null and rectTime != ''">rect_time,</if>
|
||||
<if test="rectDesc != null and rectDesc != ''" >rect_desc,</if>
|
||||
<if test="rectStatus != null">rect_status,</if>
|
||||
<if test="buildBeforeDesc != null">build_before_desc,</if>
|
||||
<if test="buildUnderDesc != null">build_under_desc,</if>
|
||||
|
|
@ -39,18 +39,18 @@
|
|||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id},</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="majorName != null">#{majorName},</if>
|
||||
<if test="majorName != null and majorName != ''">#{majorName},</if>
|
||||
<if test="gxId != null and gxId != ''">#{gxId},</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="vioPlace != null">#{vioPlace},</if>
|
||||
<if test="vioDesc != null">#{vioDesc},</if>
|
||||
<if test="vioPlace != null and vioPlace != ''">#{vioPlace},</if>
|
||||
<if test="vioDesc != null and vioDesc != ''">#{vioDesc},</if>
|
||||
<if test="rectDate != null and rectDate != ''">#{rectDate},</if>
|
||||
<if test="rectUserName != null">#{rectUserName},</if>
|
||||
<if test="rectTime != null">#{rectTime},</if>
|
||||
<if test="rectUserName != null and rectUserName != ''">#{rectUserName},</if>
|
||||
<if test="rectTime != null and rectTime != ''">#{rectTime},</if>
|
||||
<if test="rectDesc != null and rectDesc != ''">#{rectDesc},</if>
|
||||
<if test="rectStatus != null">#{rectStatus},</if>
|
||||
<if test="buildBeforeDesc != null">#{buildBeforeDesc},</if>
|
||||
|
|
|
|||
|
|
@ -1,191 +1,202 @@
|
|||
<?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">
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.imgTool.imgUpload.dao.QualityInspectionDao">
|
||||
|
||||
<insert id="insertQualityInspection" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
INSERT INTO tb_quality_inspection
|
||||
(
|
||||
pro_id,
|
||||
pro_name,
|
||||
major_id,
|
||||
major_name,
|
||||
gx_id,
|
||||
gx_name,
|
||||
check_user_name,
|
||||
check_date,
|
||||
check_place,
|
||||
check_desc,
|
||||
rect_date,
|
||||
rect_user_name,
|
||||
rect_time,
|
||||
rect_desc,
|
||||
rect_status,
|
||||
data_source,
|
||||
create_user_id,
|
||||
create_user_name,
|
||||
create_time
|
||||
)values (
|
||||
#{proId},
|
||||
#{proName},
|
||||
#{majorId},
|
||||
#{majorName},
|
||||
#{gxId},
|
||||
#{gxName},
|
||||
#{checkUserName},
|
||||
#{vioDate},
|
||||
#{vioPlace},
|
||||
#{vioDesc},
|
||||
#{rectDate},
|
||||
#{rectUserName},
|
||||
#{rectTime},
|
||||
#{rectDesc},
|
||||
#{rectStatus},
|
||||
#{dataSource},
|
||||
#{createUserId},
|
||||
#{createUserName},
|
||||
#{createTime}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertQualityInspection" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
INSERT INTO tb_quality_inspection
|
||||
(
|
||||
pro_id,
|
||||
pro_name,
|
||||
major_id,
|
||||
major_name,
|
||||
gx_id,
|
||||
gx_name,
|
||||
check_user_name,
|
||||
<if test="vioDate != null and vioDate !='' ">
|
||||
check_date,
|
||||
</if>
|
||||
check_place,
|
||||
check_desc,
|
||||
<if test="rectDate != null and rectDate !='' ">
|
||||
rect_date,
|
||||
</if>
|
||||
rect_user_name,
|
||||
<if test="rectTime != null and rectTime !='' ">
|
||||
rect_time,
|
||||
</if>
|
||||
rect_desc,
|
||||
rect_status,
|
||||
data_source,
|
||||
create_user_id,
|
||||
create_user_name,
|
||||
create_time
|
||||
)values (
|
||||
#{proId},
|
||||
#{proName},
|
||||
#{majorId},
|
||||
#{majorName},
|
||||
#{gxId},
|
||||
#{gxName},
|
||||
#{checkUserName},
|
||||
<if test="vioDate != null and vioDate !='' ">
|
||||
#{vioDate},
|
||||
</if>
|
||||
#{vioPlace},
|
||||
#{vioDesc},
|
||||
<if test="rectDate != null and rectDate !='' ">
|
||||
#{rectDate},
|
||||
</if>
|
||||
#{rectUserName},
|
||||
<if test="rectTime != null and rectTime !='' ">
|
||||
#{rectTime},
|
||||
</if>
|
||||
#{rectDesc},
|
||||
#{rectStatus},
|
||||
#{dataSource},
|
||||
#{createUserId},
|
||||
#{createUserName},
|
||||
#{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateQualityInspectionById">
|
||||
UPDATE tb_quality_inspection
|
||||
<set>
|
||||
<if test="proId != null">
|
||||
pro_id = #{proId},
|
||||
</if>
|
||||
<if test="proName != null">
|
||||
pro_name = #{proName},
|
||||
</if>
|
||||
<if test="majorId != null">
|
||||
major_id = #{majorId},
|
||||
</if>
|
||||
<if test="majorName != null">
|
||||
major_name = #{majorName},
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
gx_id = #{gxId},
|
||||
</if>
|
||||
<if test="gxName != null">
|
||||
gx_name = #{gxName},
|
||||
</if>
|
||||
<if test="checkUserName != null">
|
||||
check_user_name = #{checkUserName},
|
||||
</if>
|
||||
<if test="vioDate != null">
|
||||
check_date = #{vioDate},
|
||||
</if>
|
||||
<if test="vioPlace != null">
|
||||
check_place = #{vioPlace},
|
||||
</if>
|
||||
<if test="vioDesc != null">
|
||||
check_desc = #{vioDesc},
|
||||
</if>
|
||||
<if test="rectDate != null">
|
||||
rect_date = #{rectDate},
|
||||
</if>
|
||||
<if test="rectUserName != null">
|
||||
rect_user_name = #{rectUserName},
|
||||
</if>
|
||||
<if test="rectTime != null">
|
||||
rect_time = #{rectTime},
|
||||
</if>
|
||||
<if test="rectDesc != null">
|
||||
rect_desc = #{rectDesc},
|
||||
</if>
|
||||
<if test="rectStatus != null">
|
||||
rect_status = #{rectStatus},
|
||||
</if>
|
||||
<if test="dataSource != null">
|
||||
data_source = #{dataSource},
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
update_user_id = #{updateUserId},
|
||||
</if>
|
||||
<if test="updateUserName != null">
|
||||
update_user_name = #{updateUserName}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateQualityInspectionById">
|
||||
UPDATE tb_quality_inspection
|
||||
<set>
|
||||
<if test="proId != null">
|
||||
pro_id = #{proId},
|
||||
</if>
|
||||
<if test="proName != null">
|
||||
pro_name = #{proName},
|
||||
</if>
|
||||
<if test="majorId != null">
|
||||
major_id = #{majorId},
|
||||
</if>
|
||||
<if test="majorName != null">
|
||||
major_name = #{majorName},
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
gx_id = #{gxId},
|
||||
</if>
|
||||
<if test="gxName != null">
|
||||
gx_name = #{gxName},
|
||||
</if>
|
||||
<if test="checkUserName != null">
|
||||
check_user_name = #{checkUserName},
|
||||
</if>
|
||||
<if test="vioDate != null and vioDate != ''">
|
||||
check_date = #{vioDate},
|
||||
</if>
|
||||
<if test="vioPlace != null">
|
||||
check_place = #{vioPlace},
|
||||
</if>
|
||||
<if test="vioDesc != null">
|
||||
check_desc = #{vioDesc},
|
||||
</if>
|
||||
<if test="rectDate != null and rectDate != ''">
|
||||
rect_date = #{rectDate},
|
||||
</if>
|
||||
<if test="rectUserName != null">
|
||||
rect_user_name = #{rectUserName},
|
||||
</if>
|
||||
<if test="rectTime != null and rectTime != ''">
|
||||
rect_time = #{rectTime},
|
||||
</if>
|
||||
<if test="rectDesc != null">
|
||||
rect_desc = #{rectDesc},
|
||||
</if>
|
||||
<if test="rectStatus != null">
|
||||
rect_status = #{rectStatus},
|
||||
</if>
|
||||
<if test="dataSource != null">
|
||||
data_source = #{dataSource},
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
update_user_id = #{updateUserId},
|
||||
</if>
|
||||
<if test="updateUserName != null">
|
||||
update_user_name = #{updateUserName}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="delQualityInspectionById">
|
||||
update tb_quality_inspection set is_active = '0'
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
<delete id="delQualityInspectionById">
|
||||
update tb_quality_inspection
|
||||
set is_active = '0'
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
|
||||
SELECT
|
||||
tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.check_date as vioDate,
|
||||
tsv.check_place as vioPlace,
|
||||
tsv.check_desc as vioDesc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source,
|
||||
count(DISTINCT sfr.id) as vioPhotoNum,
|
||||
count(DISTINCT sfr2.id) as rectPhotoNum,
|
||||
group_concat(DISTINCT sfr.original_file_path) as vioPhoto,
|
||||
group_concat(DISTINCT sfr2.original_file_path) as rectPhoto
|
||||
FROM
|
||||
tb_quality_inspection tsv
|
||||
LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id
|
||||
AND sfr.source_type = '3' and sfr.is_active = '1'
|
||||
LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id
|
||||
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'
|
||||
<where>
|
||||
tsv.is_active = '1'
|
||||
<if test="proId != null">
|
||||
and tsv.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="proType != null and proType != ''">
|
||||
and tp.pro_type = #{proType}
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
and tsv.gx_id = #{gxId}
|
||||
</if>
|
||||
<if test="proStatus != null and proStatus != ''">
|
||||
and tp.status = #{proStatus}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and locate(#{keyWord},tsv.check_place)
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY tsv.id
|
||||
</select>
|
||||
<select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
|
||||
SELECT
|
||||
tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.check_date as vioDate,
|
||||
tsv.check_place as vioPlace,
|
||||
tsv.check_desc as vioDesc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source,
|
||||
count(DISTINCT sfr.id) as vioPhotoNum,
|
||||
count(DISTINCT sfr2.id) as rectPhotoNum,
|
||||
group_concat(DISTINCT sfr.original_file_path) as vioPhoto,
|
||||
group_concat(DISTINCT sfr2.original_file_path) as rectPhoto
|
||||
FROM
|
||||
tb_quality_inspection tsv
|
||||
LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id
|
||||
AND sfr.source_type = '3' and sfr.is_active = '1'
|
||||
LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id
|
||||
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'
|
||||
<where>
|
||||
tsv.is_active = '1'
|
||||
<if test="proId != null">
|
||||
and tsv.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="proType != null and proType != ''">
|
||||
and tp.pro_type = #{proType}
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
and tsv.gx_id = #{gxId}
|
||||
</if>
|
||||
<if test="proStatus != null and proStatus != ''">
|
||||
and tp.status = #{proStatus}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and locate(#{keyWord},tsv.check_place)
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY tsv.id
|
||||
</select>
|
||||
<select id="getQualityInspectionById" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
|
||||
SELECT
|
||||
tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.check_date as vioDate,
|
||||
tsv.check_place as vioPlace,
|
||||
tsv.check_desc as vioDesc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source
|
||||
FROM
|
||||
tb_quality_inspection tsv
|
||||
WHERE tsv.id = #{id}
|
||||
</select>
|
||||
SELECT tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.check_date as vioDate,
|
||||
tsv.check_place as vioPlace,
|
||||
tsv.check_desc as vioDesc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source
|
||||
FROM tb_quality_inspection tsv
|
||||
WHERE tsv.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1,264 +1,271 @@
|
|||
<?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">
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.imgTool.imgUpload.dao.SafetyViolationDao">
|
||||
|
||||
<insert id="insertSafetyViolation" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
INSERT INTO tb_safety_violations
|
||||
(
|
||||
pro_id,
|
||||
pro_name,
|
||||
major_id,
|
||||
major_name,
|
||||
gx_id,
|
||||
gx_name,
|
||||
check_user_name,
|
||||
vio_date,
|
||||
vio_place,
|
||||
vio_desc,
|
||||
rect_date,
|
||||
rect_user_name,
|
||||
rect_time,
|
||||
rect_desc,
|
||||
rect_status,
|
||||
data_source,
|
||||
create_user_id,
|
||||
create_user_name,
|
||||
create_time
|
||||
)values (
|
||||
#{proId},
|
||||
#{proName},
|
||||
#{majorId},
|
||||
#{majorName},
|
||||
#{gxId},
|
||||
#{gxName},
|
||||
#{checkUserName},
|
||||
#{vioDate},
|
||||
#{vioPlace},
|
||||
#{vioDesc},
|
||||
#{rectDate},
|
||||
#{rectUserName},
|
||||
#{rectTime},
|
||||
#{rectDesc},
|
||||
#{rectStatus},
|
||||
#{dataSource},
|
||||
#{createUserId},
|
||||
#{createUserName},
|
||||
#{createTime}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSafetyViolation" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
INSERT INTO tb_safety_violations
|
||||
(
|
||||
pro_id,
|
||||
pro_name,
|
||||
major_id,
|
||||
major_name,
|
||||
gx_id,
|
||||
gx_name,
|
||||
check_user_name,
|
||||
<if test="vioDate != null and vioDate !='' ">
|
||||
vio_date,
|
||||
</if>
|
||||
vio_place,
|
||||
vio_desc,
|
||||
<if test="rectDate != null and rectDate !='' ">
|
||||
rect_date,
|
||||
</if>
|
||||
rect_user_name,
|
||||
<if test="rectTime != null and rectTime !='' ">
|
||||
rect_time,
|
||||
</if>
|
||||
rect_desc,
|
||||
rect_status,
|
||||
data_source,
|
||||
create_user_id,
|
||||
create_user_name
|
||||
)values (
|
||||
#{proId},
|
||||
#{proName},
|
||||
#{majorId},
|
||||
#{majorName},
|
||||
#{gxId},
|
||||
#{gxName},
|
||||
#{checkUserName},
|
||||
<if test="vioDate != null and vioDate !='' ">
|
||||
#{vioDate},
|
||||
</if>
|
||||
#{vioPlace},
|
||||
#{vioDesc},
|
||||
<if test="rectDate != null and rectDate !='' ">
|
||||
#{rectDate},
|
||||
</if>
|
||||
#{rectUserName},
|
||||
<if test="rectTime != null and rectTime !='' ">
|
||||
#{rectTime},
|
||||
</if>
|
||||
#{rectDesc},
|
||||
#{rectStatus},
|
||||
#{dataSource},
|
||||
#{createUserId},
|
||||
#{createUserName}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertImgPhoto">
|
||||
INSERT INTO sys_file_resource
|
||||
(
|
||||
file_name,
|
||||
file_suffix,
|
||||
file_size,
|
||||
original_file_path,
|
||||
compress_file_path,
|
||||
file_type,
|
||||
source_id,
|
||||
upload_type,
|
||||
source_type,
|
||||
source_type_name,
|
||||
create_user,
|
||||
create_user_name
|
||||
)values
|
||||
<foreach collection="fileList" item="item" separator=",">
|
||||
(
|
||||
#{item.fileName},
|
||||
#{item.fileSuffix},
|
||||
#{item.fileSize},
|
||||
#{item.originalFilePath},
|
||||
#{item.compressFilePath},
|
||||
#{item.fileType},
|
||||
#{item.sourceId},
|
||||
#{item.uploadType},
|
||||
#{item.sourceType},
|
||||
#{item.sourceTypeName},
|
||||
#{item.createUser},
|
||||
#{item.createUserName}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertImgPhoto">
|
||||
INSERT INTO sys_file_resource
|
||||
(
|
||||
file_name,
|
||||
file_suffix,
|
||||
file_size,
|
||||
original_file_path,
|
||||
compress_file_path,
|
||||
file_type,
|
||||
source_id,
|
||||
upload_type,
|
||||
source_type,
|
||||
source_type_name,
|
||||
create_user,
|
||||
create_user_name
|
||||
)values
|
||||
<foreach collection="fileList" item="item" separator=",">
|
||||
(
|
||||
#{item.fileName},
|
||||
#{item.fileSuffix},
|
||||
#{item.fileSize},
|
||||
#{item.originalFilePath},
|
||||
#{item.compressFilePath},
|
||||
#{item.fileType},
|
||||
#{item.sourceId},
|
||||
#{item.uploadType},
|
||||
#{item.sourceType},
|
||||
#{item.sourceTypeName},
|
||||
#{item.createUser},
|
||||
#{item.createUserName}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateSafetyViolationById">
|
||||
UPDATE tb_safety_violations
|
||||
<set>
|
||||
<if test="proId != null">
|
||||
pro_id = #{proId},
|
||||
</if>
|
||||
<if test="proName != null">
|
||||
pro_name = #{proName},
|
||||
</if>
|
||||
<if test="majorId != null">
|
||||
major_id = #{majorId},
|
||||
</if>
|
||||
<if test="majorName != null">
|
||||
major_name = #{majorName},
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
gx_id = #{gxId},
|
||||
</if>
|
||||
<if test="gxName != null">
|
||||
gx_name = #{gxName},
|
||||
</if>
|
||||
<if test="checkUserName != null">
|
||||
check_user_name = #{checkUserName},
|
||||
</if>
|
||||
<if test="vioDate != null">
|
||||
vio_date = #{vioDate},
|
||||
</if>
|
||||
<if test="vioPlace != null">
|
||||
vio_place = #{vioPlace},
|
||||
</if>
|
||||
<if test="vioDesc != null">
|
||||
vio_desc = #{vioDesc},
|
||||
</if>
|
||||
<if test="rectDate != null">
|
||||
rect_date = #{rectDate},
|
||||
</if>
|
||||
<if test="rectUserName != null">
|
||||
rect_user_name = #{rectUserName},
|
||||
</if>
|
||||
<if test="rectTime != null">
|
||||
rect_time = #{rectTime},
|
||||
</if>
|
||||
<if test="rectDesc != null">
|
||||
rect_desc = #{rectDesc},
|
||||
</if>
|
||||
<if test="rectStatus != null">
|
||||
rect_status = #{rectStatus},
|
||||
</if>
|
||||
<if test="dataSource != null">
|
||||
data_source = #{dataSource},
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
update_user_id = #{updateUserId},
|
||||
</if>
|
||||
<if test="updateUserName != null">
|
||||
update_user_name = #{updateUserName}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateSafetyViolationById">
|
||||
UPDATE tb_safety_violations
|
||||
<set>
|
||||
<if test="proId != null">
|
||||
pro_id = #{proId},
|
||||
</if>
|
||||
<if test="proName != null">
|
||||
pro_name = #{proName},
|
||||
</if>
|
||||
<if test="majorId != null">
|
||||
major_id = #{majorId},
|
||||
</if>
|
||||
<if test="majorName != null">
|
||||
major_name = #{majorName},
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
gx_id = #{gxId},
|
||||
</if>
|
||||
<if test="gxName != null">
|
||||
gx_name = #{gxName},
|
||||
</if>
|
||||
<if test="checkUserName != null">
|
||||
check_user_name = #{checkUserName},
|
||||
</if>
|
||||
<if test="vioDate != null and vioDate != ''">
|
||||
vio_date = #{vioDate},
|
||||
</if>
|
||||
<if test="vioPlace != null">
|
||||
vio_place = #{vioPlace},
|
||||
</if>
|
||||
<if test="vioDesc != null">
|
||||
vio_desc = #{vioDesc},
|
||||
</if>
|
||||
<if test="rectDate != null and rectDate != ''">
|
||||
rect_date = #{rectDate},
|
||||
</if>
|
||||
<if test="rectUserName != null">
|
||||
rect_user_name = #{rectUserName},
|
||||
</if>
|
||||
<if test="rectTime != null and rectTime != ''">
|
||||
rect_time = #{rectTime},
|
||||
</if>
|
||||
<if test="rectDesc != null">
|
||||
rect_desc = #{rectDesc},
|
||||
</if>
|
||||
<if test="rectStatus != null">
|
||||
rect_status = #{rectStatus},
|
||||
</if>
|
||||
<if test="dataSource != null">
|
||||
data_source = #{dataSource},
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
update_user_id = #{updateUserId},
|
||||
</if>
|
||||
<if test="updateUserName != null">
|
||||
update_user_name = #{updateUserName}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="delImgPhoto">
|
||||
update sys_file_resource set is_active = '0'
|
||||
WHERE
|
||||
id IN
|
||||
<foreach collection="delFileList" item="item" separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="delImgPhoto">
|
||||
update sys_file_resource set is_active = '0'
|
||||
WHERE
|
||||
id IN
|
||||
<foreach collection="delFileList" item="item" separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delImgPhotoBySourceId">
|
||||
update sys_file_resource set is_active = '0'
|
||||
WHERE
|
||||
source_id = #{sourceId}
|
||||
AND upload_type = #{uploadType}
|
||||
</delete>
|
||||
<delete id="delImgPhotoBySourceId">
|
||||
update sys_file_resource
|
||||
set is_active = '0'
|
||||
WHERE source_id = #{sourceId}
|
||||
AND upload_type = #{uploadType}
|
||||
</delete>
|
||||
|
||||
<delete id="delSafetyViolationById">
|
||||
update tb_safety_violations set is_active = '0'
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
<delete id="delSafetyViolationById">
|
||||
update tb_safety_violations
|
||||
set is_active = '0'
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
|
||||
SELECT
|
||||
tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.vio_date,
|
||||
tsv.vio_place,
|
||||
tsv.vio_desc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source,
|
||||
count(DISTINCT sfr.id) as vioPhotoNum,
|
||||
count(DISTINCT sfr2.id) as rectPhotoNum,
|
||||
group_concat(DISTINCT sfr.original_file_path) as vioPhoto,
|
||||
group_concat(DISTINCT sfr2.original_file_path) as rectPhoto
|
||||
FROM
|
||||
tb_safety_violations tsv
|
||||
LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id
|
||||
AND sfr.source_type = '1' and sfr.is_active = '1'
|
||||
LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id
|
||||
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'
|
||||
<where>
|
||||
tsv.is_active = '1'
|
||||
<if test="proId != null">
|
||||
and tsv.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="proType != null and proType != ''">
|
||||
and tp.pro_type = #{proType}
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
and tsv.gx_id = #{gxId}
|
||||
</if>
|
||||
<if test="proStatus != null and proStatus != ''">
|
||||
and tp.status = #{proStatus}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and locate(#{keyWord},tsv.vio_place)
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY tsv.id
|
||||
</select>
|
||||
<select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
|
||||
SELECT
|
||||
tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.vio_date,
|
||||
tsv.vio_place,
|
||||
tsv.vio_desc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source,
|
||||
count(DISTINCT sfr.id) as vioPhotoNum,
|
||||
count(DISTINCT sfr2.id) as rectPhotoNum,
|
||||
group_concat(DISTINCT sfr.original_file_path) as vioPhoto,
|
||||
group_concat(DISTINCT sfr2.original_file_path) as rectPhoto
|
||||
FROM
|
||||
tb_safety_violations tsv
|
||||
LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id
|
||||
AND sfr.source_type = '1' and sfr.is_active = '1'
|
||||
LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id
|
||||
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'
|
||||
<where>
|
||||
tsv.is_active = '1'
|
||||
<if test="proId != null">
|
||||
and tsv.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="proType != null and proType != ''">
|
||||
and tp.pro_type = #{proType}
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
and tsv.gx_id = #{gxId}
|
||||
</if>
|
||||
<if test="proStatus != null and proStatus != ''">
|
||||
and tp.status = #{proStatus}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and locate(#{keyWord},tsv.vio_place)
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY tsv.id
|
||||
</select>
|
||||
<select id="getSafetyViolationById" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
|
||||
SELECT
|
||||
tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.vio_date,
|
||||
tsv.vio_place,
|
||||
tsv.vio_desc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source
|
||||
FROM
|
||||
tb_safety_violations tsv
|
||||
WHERE tsv.id = #{id}
|
||||
</select>
|
||||
SELECT tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.vio_date,
|
||||
tsv.vio_place,
|
||||
tsv.vio_desc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source
|
||||
FROM tb_safety_violations tsv
|
||||
WHERE tsv.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getImgPhotoList" resultType="com.bonus.imgTool.system.vo.dto.FileStorageDto">
|
||||
SELECT
|
||||
sfr.id,
|
||||
sfr.file_name,
|
||||
sfr.file_suffix,
|
||||
sfr.file_size,
|
||||
sfr.original_file_path,
|
||||
sfr.compress_file_path,
|
||||
sfr.watermark_file_path,
|
||||
sfr.file_type,
|
||||
sfr.source_id,
|
||||
sfr.upload_type,
|
||||
sfr.source_type,
|
||||
sfr.source_type_name,
|
||||
sfr.create_user,
|
||||
sfr.create_user_name
|
||||
FROM
|
||||
sys_file_resource sfr
|
||||
WHERE sfr.source_id = #{sourceId}
|
||||
AND sfr.source_type = #{sourceType}
|
||||
And sfr.is_active= '1'
|
||||
</select>
|
||||
<select id="getImgPhotoList" resultType="com.bonus.imgTool.system.vo.dto.FileStorageDto">
|
||||
SELECT sfr.id,
|
||||
sfr.file_name,
|
||||
sfr.file_suffix,
|
||||
sfr.file_size,
|
||||
sfr.original_file_path,
|
||||
sfr.compress_file_path,
|
||||
sfr.watermark_file_path,
|
||||
sfr.file_type,
|
||||
sfr.source_id,
|
||||
sfr.upload_type,
|
||||
sfr.source_type,
|
||||
sfr.source_type_name,
|
||||
sfr.create_user,
|
||||
sfr.create_user_name
|
||||
FROM sys_file_resource sfr
|
||||
WHERE sfr.source_id = #{sourceId}
|
||||
AND sfr.source_type = #{sourceType}
|
||||
And sfr.is_active = '1'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue