代码优化
This commit is contained in:
parent
99501cbdea
commit
c9d58da3af
|
|
@ -134,6 +134,9 @@ public class ImportantMatterServiceImpl implements ImportantMatterService {
|
|||
String CreateUserName = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getUsername(): null;
|
||||
data.setUpdateUserId(CreateUserId);
|
||||
data.setUpdateUserName(CreateUserName);
|
||||
if (data.getTime().isEmpty()){
|
||||
data.setTime(null);
|
||||
}
|
||||
importantMatterMapper.updateImportantMatter(data);
|
||||
//附件先删除,后新增
|
||||
sysFileResourceService.deleteFileResource(data.getId());
|
||||
|
|
|
|||
|
|
@ -137,6 +137,9 @@ public class SafetyMeasuresServiceImpl implements SafetyMeasuresService {
|
|||
String CreateUserName = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getUsername(): null;
|
||||
data.setUpdateUserId(CreateUserId);
|
||||
data.setUpdateUserName(CreateUserName);
|
||||
if (data.getCheckDate().isEmpty()){
|
||||
data.setCheckDate(null);
|
||||
}
|
||||
//修改
|
||||
safetyMeasuresMapper.updateSafetyMeasures(data);
|
||||
//附件先删除,后新增
|
||||
|
|
@ -153,6 +156,12 @@ public class SafetyMeasuresServiceImpl implements SafetyMeasuresService {
|
|||
//修改综合查询
|
||||
ComprehensiveQueryVo comprehensiveQueryVo = new ComprehensiveQueryVo();
|
||||
BeanUtils.copyProperties(data,comprehensiveQueryVo);
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (data.getCheckDate() != null && !data.getCheckDate().trim().isEmpty()) {
|
||||
comprehensiveQueryVo.setRectDate(dateFormat.parse(data.getCheckDate()));
|
||||
}
|
||||
comprehensiveQueryVo.setVioPlace(data.getCheckPlace());
|
||||
comprehensiveQueryVo.setVioDesc(data.getCheckDesc());
|
||||
synthesisQueryService.updateComprehensiveQuery(comprehensiveQueryVo);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
|
|
|
|||
|
|
@ -47,22 +47,10 @@
|
|||
</insert>
|
||||
|
||||
<update id="updateCoordinatePhoto">
|
||||
update tb_coordinate_photo
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="proId != null and proId != ''">pro_id = #{proId},</if>
|
||||
<if test="proName != null and proName != ''">pro_name = #{proName},</if>
|
||||
<if test="majorId != null and majorId != ''">major_id = #{majorId},</if>
|
||||
<if test="majorName != null and majorName != ''">major_name = #{majorName},</if>
|
||||
<if test="gxId != null and gxId != ''">gx_id = #{gxId},</if>
|
||||
<if test="gxName != null and gxName != ''">gx_name = #{gxName},</if>
|
||||
<if test="buildPlace != null and buildPlace != ''">build_place = #{buildPlace},</if>
|
||||
<if test="buildBeforeDesc != null ">build_before_desc = #{buildBeforeDesc},</if>
|
||||
<if test="buildUnderDesc != null ">build_under_desc = #{buildUnderDesc},</if>
|
||||
<if test="buildAfterDesc != null ">build_after_desc = #{buildAfterDesc},</if>
|
||||
<if test="updateUserId != null and updateUserId != ''">update_user_id = #{updateUserId},</if>
|
||||
<if test="updateUserName != null and updateUserName != ''">update_user_name = #{updateUserName},</if>
|
||||
update_time = NOW()
|
||||
</trim>
|
||||
update tb_coordinate_photo set pro_id = #{proId},pro_name = #{proName},gx_id = #{gxId},gx_name = #{gxName},
|
||||
build_place = #{buildPlace},build_before_desc = #{buildBeforeDesc},build_under_desc = #{buildUnderDesc},
|
||||
build_after_desc = #{buildAfterDesc},update_user_id = #{updateUserId},update_user_name = #{updateUserName},
|
||||
major_name = #{majorName},major_id = #{majorId},update_time = NOW()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
|
|
|||
|
|
@ -46,21 +46,10 @@
|
|||
</insert>
|
||||
|
||||
<update id="updateImportantMatter">
|
||||
update tb_main_matter_publicize_photo
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="proId != null and proId != ''">pro_id = #{proId},</if>
|
||||
<if test="proName != null and proName != ''">pro_name = #{proName},</if>
|
||||
<if test="majorId != null and majorId != ''">major_id = #{majorId},</if>
|
||||
<if test="majorName != null and majorName != ''">major_name = #{majorName},</if>
|
||||
<if test="gxId != null and gxId != ''">gx_id = #{gxId},</if>
|
||||
<if test="gxName != null and gxName != ''">gx_name = #{gxName},</if>
|
||||
<if test="time != null and time != ''">time = #{time},</if>
|
||||
<if test="title != null and title != ''">title = #{title},</if>
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
<if test="updateUserId != null and updateUserId != ''">update_user_id = #{updateUserId},</if>
|
||||
<if test="updateUserName != null and updateUserName != ''">update_user_name = #{updateUserName},</if>
|
||||
update_time = NOW()
|
||||
</trim>
|
||||
update tb_main_matter_publicize_photo set pro_id = #{proId},pro_name = #{proName},major_id = #{majorId},
|
||||
major_name = #{majorName},gx_id = #{gxId},gx_name = #{gxName},time = #{time},
|
||||
title = #{title},content = #{content},
|
||||
update_user_id = #{updateUserId},update_user_name = #{updateUserName},update_time = NOW()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
|
|
|||
|
|
@ -47,22 +47,9 @@
|
|||
|
||||
</insert>
|
||||
<update id="updateSafetyMeasures">
|
||||
update tb_safety_measure
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="proId != null and proId != ''">pro_id = #{proId},</if>
|
||||
<if test="proName != null and proName != ''">pro_name = #{proName},</if>
|
||||
<if test="majorId != null and majorId != ''">major_id = #{majorId},</if>
|
||||
<if test="majorName != null and majorName != ''">major_name = #{majorName},</if>
|
||||
<if test="gxId != null and gxId != ''">gx_id = #{gxId},</if>
|
||||
<if test="gxName != null and gxName != ''">gx_name = #{gxName},</if>
|
||||
<if test="checkUserName != null and checkUserName != ''">check_user_name = #{checkUserName},</if>
|
||||
<if test="checkDate != null and checkDate != ''">check_date = #{checkDate},</if>
|
||||
<if test="checkPlace != null and checkPlace != ''">check_place = #{checkPlace},</if>
|
||||
<if test="checkDesc != null and checkDesc != ''">check_desc = #{checkDesc},</if>
|
||||
<if test="updateUserId != null and updateUserId != ''">update_user_id = #{updateUserId},</if>
|
||||
<if test="updateUserName != null and updateUserName != ''">update_user_name = #{updateUserName},</if>
|
||||
update_time = NOW()
|
||||
</trim>
|
||||
update tb_safety_measure set pro_id = #{proId},pro_name = #{proName},major_id = #{majorId},major_name = #{majorName},
|
||||
gx_id = #{gxId},gx_name = #{gxName},check_user_name = #{checkUserName},check_date = #{checkDate},check_place = #{checkPlace},
|
||||
check_desc = #{checkDesc},update_user_id = #{updateUserId},update_user_name = #{updateUserName},update_time = NOW()
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteSafetyMeasures">
|
||||
|
|
|
|||
Loading…
Reference in New Issue