Compare commits

..

No commits in common. "bdf8e4e1da1a497742fc043b80ab86d6ddfe61f0" and "8abea9c7747f595e6cfc6d02495eab0572bd0a8f" have entirely different histories.

7 changed files with 510 additions and 540 deletions

View File

@ -155,7 +155,6 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
list.forEach(vo -> { list.forEach(vo -> {
vo.setId(num[0]); vo.setId(num[0]);
num[0]++; num[0]++;
vo.setRectStatus( "1".equals(vo.getRectStatus())?"已整改":"待整改");
}); });
ExportParams exportParams = new ExportParams("质量检查", "质量检查", ExcelType.XSSF); ExportParams exportParams = new ExportParams("质量检查", "质量检查", ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, SafetyViolationVo.class, list); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, SafetyViolationVo.class, list);

View File

@ -100,7 +100,6 @@ 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());
@ -167,7 +166,6 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
list.forEach(vo -> { list.forEach(vo -> {
vo.setId(num[0]); vo.setId(num[0]);
num[0]++; num[0]++;
vo.setRectStatus( "1".equals(vo.getRectStatus())?"已整改":"待整改");
}); });
ExportParams exportParams = new ExportParams("安全违章", "安全违章", ExcelType.XSSF); ExportParams exportParams = new ExportParams("安全违章", "安全违章", ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, SafetyViolationVo.class, list); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, SafetyViolationVo.class, list);

View File

@ -12,38 +12,6 @@ import java.util.List;
*/ */
@Data @Data
public class SafetyViolationVo extends PageEntity { public class SafetyViolationVo extends PageEntity {
/**
* id
*/
@Excel(name = "序号", width = 20.0, orderNum = "0")
private Long id;
/**
* 工程名称
*/
@Excel(name = "工程名称", width = 20.0, orderNum = "1")
private String proName;
/**
* 工序名称
*/
@Excel(name = "工序名称", width = 20.0, orderNum = "2")
private String gxName;
/**
* 违章地点
*/
@Excel(name = "违章/检查地点", width = 20.0, orderNum = "3")
private String vioPlace;
/**
* 违章描述
*/
@Excel(name = "违章/检查描述", width = 20.0, orderNum = "4")
private String vioDesc;
/**
* 违章照片数量
*/
@Excel(name = "违章/缺陷照片数量", width = 20.0, orderNum = "5")
private String vioPhotoNum;
/** /**
* 检查人 * 检查人
*/ */
@ -54,38 +22,6 @@ public class SafetyViolationVo extends PageEntity {
*/ */
@Excel(name = "违章/检查时间", width = 20.0, orderNum = "7") @Excel(name = "违章/检查时间", width = 20.0, orderNum = "7")
private String createTime; private String createTime;
/**
* 整改期限
*/
@Excel(name = "整改期限", width = 20.0, orderNum = "8")
private String rectDate;
/**
* 整改状态 0.待整改 1.已整改
*/
@Excel(name = "整改状态", width = 20.0, orderNum = "9",replace = {"待整改_0,已整改_1"})
private String rectStatus;
/**
* 整改说明
*/
@Excel(name = "整改说明", width = 20.0, orderNum = "10")
private String rectDesc;
/**
* 整改照片数量
*/
@Excel(name = "整改照片数量", width = 20.0, orderNum = "11")
private String rectPhotoNum;
/**
* 整改人
*/
@Excel(name = "整改人", width = 20.0, orderNum = "12")
private String rectUserName;
/**
* 整改时间
*/
@Excel(name = "整改时间", width = 20.0, orderNum = "13")
private String rectTime;
/** /**
* 创建人 * 创建人
*/ */
@ -102,8 +38,16 @@ public class SafetyViolationVo extends PageEntity {
* 工序id * 工序id
*/ */
private Long gxId; private Long gxId;
/**
* 工序名称
*/
@Excel(name = "工序名称", width = 20.0, orderNum = "2")
private String gxName;
/**
* id
*/
@Excel(name = "序号", width = 20.0, orderNum = "0")
private Long id;
/** /**
* 是否可用 1.可用 0.不可用 * 是否可用 1.可用 0.不可用
*/ */
@ -120,8 +64,36 @@ public class SafetyViolationVo extends PageEntity {
* 工程id * 工程id
*/ */
private Long proId; private Long proId;
/**
* 工程名称
*/
@Excel(name = "工程名称", width = 20.0, orderNum = "1")
private String proName;
/**
* 整改期限
*/
@Excel(name = "整改期限", width = 20.0, orderNum = "8")
private String rectDate;
/**
* 整改说明
*/
@Excel(name = "整改说明", width = 20.0, orderNum = "10")
private String rectDesc;
/**
* 整改状态 0.待整改 1.已整改
*/
@Excel(name = "整改状态", width = 20.0, orderNum = "9",replace = "0=待整改,1=已整改")
private String rectStatus;
/**
* 整改时间
*/
@Excel(name = "整改时间", width = 20.0, orderNum = "13")
private String rectTime;
/**
* 整改人
*/
@Excel(name = "整改人", width = 20.0, orderNum = "12")
private String rectUserName;
/** /**
* 修改时间 * 修改时间
*/ */
@ -139,7 +111,26 @@ public class SafetyViolationVo extends PageEntity {
* 违章时间 * 违章时间
*/ */
private String vioDate; private String vioDate;
/**
* 违章描述
*/
@Excel(name = "违章/检查描述", width = 20.0, orderNum = "4")
private String vioDesc;
/**
* 违章地点
*/
@Excel(name = "违章/检查地点", width = 20.0, orderNum = "3")
private String vioPlace;
/**
* 违章照片数量
*/
@Excel(name = "违章/缺陷照片数量", width = 20.0, orderNum = "5")
private String vioPhotoNum;
/**
* 整改照片数量
*/
@Excel(name = "整改照片数量", width = 20.0, orderNum = "11")
private String rectPhotoNum;
/** /**
* 违章照片 * 违章照片

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 and proName != ''">pro_name,</if> <if test="proName != null">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 and majorName != ''">major_name,</if> <if test="majorName != null">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 and gxName != ''">gx_name,</if> <if test="gxName != null">gx_name,</if>
<if test="checkUserName != null and checkUserName != ''">check_user_name,</if> <if test="checkUserName != null">check_user_name,</if>
<if test="vioDate != null and vioDate != ''">vio_date,</if> <if test="vioDate != null">vio_date,</if>
<if test="vioPlace != null and vioPlace != ''" >vio_place,</if> <if test="vioPlace != null">vio_place,</if>
<if test="vioDesc != null and vioDesc != ''" >vio_desc,</if> <if test="vioDesc != null">vio_desc,</if>
<if test="rectDate != null and rectDate != ''">rect_date,</if> <if test="rectDate != null">rect_date,</if>
<if test="rectUserName != null and rectUserName != ''">rect_user_name,</if> <if test="rectUserName != null">rect_user_name,</if>
<if test="rectTime != null and rectTime != ''">rect_time,</if> <if test="rectTime != null">rect_time,</if>
<if test="rectDesc != null and rectDesc != ''" >rect_desc,</if> <if test="rectDesc != null">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 and proName != ''">#{proName},</if> <if test="proName != null">#{proName},</if>
<if test="majorId != null and majorId != ''">#{majorId},</if> <if test="majorId != null and majorId != ''">#{majorId},</if>
<if test="majorName != null and majorName != ''">#{majorName},</if> <if test="majorName != null">#{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 and checkUserName != ''">#{checkUserName},</if> <if test="checkUserName != null">#{checkUserName},</if>
<if test="vioDate != null and vioDate != ''">#{vioDate},</if> <if test="vioDate != null and vioDate != ''">#{vioDate},</if>
<if test="vioPlace != null and vioPlace != ''">#{vioPlace},</if> <if test="vioPlace != null">#{vioPlace},</if>
<if test="vioDesc != null and vioDesc != ''">#{vioDesc},</if> <if test="vioDesc != null">#{vioDesc},</if>
<if test="rectDate != null and rectDate != ''">#{rectDate},</if> <if test="rectDate != null and rectDate != ''">#{rectDate},</if>
<if test="rectUserName != null and rectUserName != ''">#{rectUserName},</if> <if test="rectUserName != null">#{rectUserName},</if>
<if test="rectTime != null and rectTime != ''">#{rectTime},</if> <if test="rectTime != null">#{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

@ -149,7 +149,7 @@
sfr.original_file_path sfr.original_file_path
FROM FROM
sys_file_resource sfr sys_file_resource sfr
LEFT JOIN sys_distinct sd ON sd.dict_value = sfr.source_type and sd.p_id = '114' LEFT JOIN sys_distinct sd ON sd.dict_value = sfr.source_type
AND sd.del_flag = 0 AND sd.del_flag = 0
LEFT JOIN tb_comprehensive_query tcq ON tcq.id = sfr.source_id and tcq.upload_type = sfr.upload_type LEFT JOIN tb_comprehensive_query tcq ON tcq.id = sfr.source_id and tcq.upload_type = sfr.upload_type
WHERE WHERE

View File

@ -1,202 +1,191 @@
<?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,
<if test="vioDate != null and vioDate !='' "> check_date,
check_date, check_place,
</if> check_desc,
check_place, rect_date,
check_desc, rect_user_name,
<if test="rectDate != null and rectDate !='' "> rect_time,
rect_date, rect_desc,
</if> rect_status,
rect_user_name, data_source,
<if test="rectTime != null and rectTime !='' "> create_user_id,
rect_time, create_user_name,
</if> create_time
rect_desc, )values (
rect_status, #{proId},
data_source, #{proName},
create_user_id, #{majorId},
create_user_name, #{majorName},
create_time #{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},
#{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 and vioDate != ''"> <if test="vioDate != null">
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 and rectDate != ''"> <if test="rectDate != null">
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 and rectTime != ''"> <if test="rectTime != null">
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 update tb_quality_inspection set is_active = '0'
set is_active = '0' WHERE id = #{id}
WHERE id = #{id} </delete>
</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 tsv.id, SELECT
tsv.pro_id, tsv.id,
tsv.pro_name, tsv.pro_id,
tsv.major_id, tsv.pro_name,
tsv.major_name, tsv.major_id,
tsv.gx_id, tsv.major_name,
tsv.gx_name, tsv.gx_id,
tsv.check_user_name, tsv.gx_name,
tsv.check_date as vioDate, tsv.check_user_name,
tsv.check_place as vioPlace, tsv.check_date as vioDate,
tsv.check_desc as vioDesc, tsv.check_place as vioPlace,
tsv.rect_date, tsv.check_desc as vioDesc,
tsv.rect_user_name, tsv.rect_date,
tsv.rect_time, tsv.rect_user_name,
tsv.rect_desc, tsv.rect_time,
tsv.rect_status, tsv.rect_desc,
tsv.data_source tsv.rect_status,
FROM tb_quality_inspection tsv tsv.data_source
WHERE tsv.id = #{id} FROM
</select> tb_quality_inspection tsv
WHERE tsv.id = #{id}
</select>
</mapper> </mapper>

View File

@ -1,271 +1,264 @@
<?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,
<if test="vioDate != null and vioDate !='' "> vio_date,
vio_date, vio_place,
</if> vio_desc,
vio_place, rect_date,
vio_desc, rect_user_name,
<if test="rectDate != null and rectDate !='' "> rect_time,
rect_date, rect_desc,
</if> rect_status,
rect_user_name, data_source,
<if test="rectTime != null and rectTime !='' "> create_user_id,
rect_time, create_user_name,
</if> create_time
rect_desc, )values (
rect_status, #{proId},
data_source, #{proName},
create_user_id, #{majorId},
create_user_name #{majorName},
)values ( #{gxId},
#{proId}, #{gxName},
#{proName}, #{checkUserName},
#{majorId}, #{vioDate},
#{majorName}, #{vioPlace},
#{gxId}, #{vioDesc},
#{gxName}, #{rectDate},
#{checkUserName}, #{rectUserName},
<if test="vioDate != null and vioDate !='' "> #{rectTime},
#{vioDate}, #{rectDesc},
</if> #{rectStatus},
#{vioPlace}, #{dataSource},
#{vioDesc}, #{createUserId},
<if test="rectDate != null and rectDate !='' "> #{createUserName},
#{rectDate}, #{createTime}
</if> )
#{rectUserName}, </insert>
<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 and vioDate != ''"> <if test="vioDate != null">
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 and rectDate != ''"> <if test="rectDate != null">
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 and rectTime != ''"> <if test="rectTime != null">
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 update sys_file_resource set is_active = '0'
set is_active = '0' WHERE
WHERE source_id = #{sourceId} source_id = #{sourceId}
AND upload_type = #{uploadType} AND upload_type = #{uploadType}
</delete> </delete>
<delete id="delSafetyViolationById"> <delete id="delSafetyViolationById">
update tb_safety_violations update tb_safety_violations set is_active = '0'
set is_active = '0' WHERE id = #{id}
WHERE id = #{id} </delete>
</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 tsv.id, SELECT
tsv.pro_id, tsv.id,
tsv.pro_name, tsv.pro_id,
tsv.major_id, tsv.pro_name,
tsv.major_name, tsv.major_id,
tsv.gx_id, tsv.major_name,
tsv.gx_name, tsv.gx_id,
tsv.check_user_name, tsv.gx_name,
tsv.vio_date, tsv.check_user_name,
tsv.vio_place, tsv.vio_date,
tsv.vio_desc, tsv.vio_place,
tsv.rect_date, tsv.vio_desc,
tsv.rect_user_name, tsv.rect_date,
tsv.rect_time, tsv.rect_user_name,
tsv.rect_desc, tsv.rect_time,
tsv.rect_status, tsv.rect_desc,
tsv.data_source tsv.rect_status,
FROM tb_safety_violations tsv tsv.data_source
WHERE tsv.id = #{id} FROM
</select> tb_safety_violations tsv
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 sfr.id, SELECT
sfr.file_name, sfr.id,
sfr.file_suffix, sfr.file_name,
sfr.file_size, sfr.file_suffix,
sfr.original_file_path, sfr.file_size,
sfr.compress_file_path, sfr.original_file_path,
sfr.watermark_file_path, sfr.compress_file_path,
sfr.file_type, sfr.watermark_file_path,
sfr.source_id, sfr.file_type,
sfr.upload_type, sfr.source_id,
sfr.source_type, sfr.upload_type,
sfr.source_type_name, sfr.source_type,
sfr.create_user, sfr.source_type_name,
sfr.create_user_name sfr.create_user,
FROM sys_file_resource sfr sfr.create_user_name
WHERE sfr.source_id = #{sourceId} FROM
AND sfr.source_type = #{sourceType} sys_file_resource sfr
And sfr.is_active = '1' WHERE sfr.source_id = #{sourceId}
</select> AND sfr.source_type = #{sourceType}
And sfr.is_active= '1'
</select>
</mapper> </mapper>