hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/controller/TRegionHazardInformController.java
@@ -2,13 +2,11 @@ import com.thhy.general.common.BasicResult; import com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto; import com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity; import com.thhy.secure.modules.biz.regionHazardInform.entity.TRegionHazardInformEntity; import com.thhy.secure.modules.biz.regionHazardInform.service.TRegionHazardInformService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; /** * @Author QiuYuHao @@ -23,27 +21,27 @@ private TRegionHazardInformService service; @PostMapping(value = "findAll") public BasicResult findAll(TRegionHazardInformDto tRegionHazardInformDto){ public BasicResult findAll(@RequestBody TRegionHazardInformDto tRegionHazardInformDto){ return service.findAll(tRegionHazardInformDto); } @GetMapping(value = "findEntity") public BasicResult findEntity(String id){ public BasicResult findEntity(@RequestParam String id){ return service.findEntity(id); } @PostMapping(value = "insert") public BasicResult insert(TRegionHazardInformEntity tRegionHazardInformEntity){ public BasicResult insert(@RequestBody RegionHazardInformEntity tRegionHazardInformEntity){ return service.insert(tRegionHazardInformEntity); } @PostMapping(value = "update") public BasicResult update(TRegionHazardInformEntity tRegionHazardInformEntity){ public BasicResult update(@RequestBody RegionHazardInformEntity tRegionHazardInformEntity){ return service.update(tRegionHazardInformEntity); } @GetMapping(value = "delete") public BasicResult delete(String id){ public BasicResult delete(@RequestParam String id){ return service.delete(id); } } hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/dto/TRegionHazardInformDto.java
@@ -9,7 +9,7 @@ */ @Data public class TRegionHazardInformDto { private Integer level;//安全等级 private Integer levelType;//安全等级 private Integer pageNum; private Integer pageSize; private String companyId; hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/entity/RegionHazardInformEntity.java
对比新文件 @@ -0,0 +1,84 @@ package com.thhy.secure.modules.biz.regionHazardInform.entity; import lombok.Data; import java.util.Date; /** * @Author QiuYuHao * @CreateDate 2023-09-27 15:00:41 */ public class RegionHazardInformEntity { private String id; private String region; private Integer levelType; private String regionColor; private String companyId; private String createUser; private Date createTime; private Integer isUse; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getRegion() { return region; } public void setRegion(String region) { this.region = region; } public Integer getLevelType() { return levelType; } public void setLevelType(Integer levelType) { this.levelType = levelType; } public String getRegionColor() { return regionColor; } public void setRegionColor(String regionColor) { this.regionColor = regionColor; } public String getCompanyId() { return companyId; } public void setCompanyId(String companyId) { this.companyId = companyId; } public String getCreateUser() { return createUser; } public void setCreateUser(String createUser) { this.createUser = createUser; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Integer getIsUse() { return isUse; } public void setIsUse(Integer isUse) { this.isUse = isUse; } } hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/entity/TRegionHazardInformEntity.java
@@ -1,9 +1,7 @@ package com.thhy.secure.modules.biz.regionHazardInform.entity; import com.thhy.general.annotations.Idkey; import lombok.Data; import java.io.Serializable; import java.util.Date; /** @@ -12,11 +10,11 @@ * 危险告知实体 */ @Data public class TRegionHazardInformEntity implements Serializable { @Idkey(value = "id") public class TRegionHazardInformEntity{ private String id; private String region; private Integer level; private Integer levelType; private String regionColor; private String companyId; private String createUser; hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/mapper/RegionHazardInformMapper.java
对比新文件 @@ -0,0 +1,28 @@ package com.thhy.secure.modules.biz.regionHazardInform.mapper; import com.thhy.general.annotations.Idkey; import com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto; import com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity; import com.thhy.secure.modules.biz.regionHazardInform.entity.TRegionHazardInformEntity; import org.apache.ibatis.annotations.Mapper; import java.util.List; /** * @Author QiuYuHao * @CreateDate 2023-09-26 13:39:01 * 危险告知mapper */ @Mapper public interface RegionHazardInformMapper { List<RegionHazardInformEntity> findAllRegionHazardInform(TRegionHazardInformDto tRegionHazardInformDto); RegionHazardInformEntity findEntity(String id); void insertTRegionHazardInform(RegionHazardInformEntity tRegionHazardInformEntity); void update(RegionHazardInformEntity tRegionHazardInformEntity); void delete(String id); } hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/mapper/TRegionHazardInformMapper.java
文件已删除 hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/TRegionHazardInformService.java
@@ -2,9 +2,7 @@ import com.thhy.general.common.BasicResult; import com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto; import com.thhy.secure.modules.biz.regionHazardInform.entity.TRegionHazardInformEntity; import java.util.List; import com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity; /** * @Author QiuYuHao @@ -17,9 +15,9 @@ BasicResult findEntity(String id); BasicResult insert(TRegionHazardInformEntity tRegionHazardInformEntity); BasicResult insert(RegionHazardInformEntity tRegionHazardInformEntity); BasicResult update(TRegionHazardInformEntity tRegionHazardInformEntity); BasicResult update(RegionHazardInformEntity tRegionHazardInformEntity); BasicResult delete(String id); } hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/impl/TRegionHazardInformServiceImpl.java
@@ -4,15 +4,16 @@ import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.general.config.SysUserInfo; import com.thhy.general.utils.UUIDUtils; import com.thhy.general.utils.UserInfoUtils; import com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto; import com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity; import com.thhy.secure.modules.biz.regionHazardInform.entity.TRegionHazardInformEntity; import com.thhy.secure.modules.biz.regionHazardInform.mapper.TRegionHazardInformMapper; import com.thhy.secure.modules.biz.regionHazardInform.mapper.RegionHazardInformMapper; import com.thhy.secure.modules.biz.regionHazardInform.service.TRegionHazardInformService; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; /** @@ -23,36 +24,37 @@ @Service public class TRegionHazardInformServiceImpl implements TRegionHazardInformService { @Autowired private TRegionHazardInformMapper tRegionHazardInformMapper; @Resource private RegionHazardInformMapper tRegionHazardInformMapper; @Override public BasicResult findAll(TRegionHazardInformDto tRegionHazardInformDto) { SysUserInfo userInfo = UserInfoUtils.getInstance().getUserInfo(); tRegionHazardInformDto.setCompanyId(userInfo.getCompanyId()); PageHelper.startPage(tRegionHazardInformDto.getPageNum(), tRegionHazardInformDto.getPageSize()); List<TRegionHazardInformEntity> all = this.tRegionHazardInformMapper.findAll(tRegionHazardInformDto); PageInfo<TRegionHazardInformEntity> pageInfo = new PageInfo<>(all); List<RegionHazardInformEntity> all = this.tRegionHazardInformMapper.findAllRegionHazardInform(tRegionHazardInformDto); PageInfo<RegionHazardInformEntity> pageInfo = new PageInfo<>(all); return BasicResult.success(pageInfo); } @Override public BasicResult findEntity(String id) { TRegionHazardInformEntity entity = this.tRegionHazardInformMapper.findEntity(id); RegionHazardInformEntity entity = this.tRegionHazardInformMapper.findEntity(id); return BasicResult.success(entity); } @Override public BasicResult insert(TRegionHazardInformEntity tRegionHazardInformEntity) { public BasicResult insert(RegionHazardInformEntity tRegionHazardInformEntity) { SysUserInfo userInfo = UserInfoUtils.getInstance().getUserInfo(); tRegionHazardInformEntity.setCompanyId(userInfo.getCompanyId()); tRegionHazardInformEntity.setCreateUser(userInfo.getRealName()); this.tRegionHazardInformMapper.insert(tRegionHazardInformEntity); tRegionHazardInformEntity.setId(UUIDUtils.create()); tRegionHazardInformMapper.insertTRegionHazardInform(tRegionHazardInformEntity); return BasicResult.success(); } @Override public BasicResult update(TRegionHazardInformEntity tRegionHazardInformEntity) { public BasicResult update(RegionHazardInformEntity tRegionHazardInformEntity) { this.tRegionHazardInformMapper.update(tRegionHazardInformEntity); return BasicResult.success(); } hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/dto/TRegionWarrantyDto.java
@@ -12,4 +12,5 @@ private Integer pageNum; private Integer pageSize; private String regionHazardInformId;//区域名称id private String companyId; } hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/service/impl/TRegionWarrantyServiceImpl.java
@@ -11,6 +11,7 @@ import com.thhy.secure.modules.biz.regionWarranty.service.TRegionWarrantyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -27,8 +28,9 @@ private TRegionWarrantyMapper tRegionWarrantyMapper; @Override @Transactional(rollbackFor = Exception.class) public BasicResult insert(TRegionWarrantyEntity tRegionWarrantyEntity) { String id = UUIDUtils.create();// String id = UUIDUtils.create(); tRegionWarrantyEntity.setId(id); tRegionWarrantyMapper.insert(tRegionWarrantyEntity); @@ -55,6 +57,7 @@ } @Override @Transactional(rollbackFor = Exception.class) public BasicResult delete(String id) { tRegionWarrantyMapper.delete(id); tRegionWarrantyMapper.deleteMiddleTable(id); @@ -62,6 +65,7 @@ } @Override @Transactional(rollbackFor = Exception.class) public BasicResult update(TRegionWarrantyEntity tRegionWarrantyEntity) { tRegionWarrantyMapper.deleteMiddleTable(tRegionWarrantyEntity.getId()); //领导 @@ -84,7 +88,7 @@ tRegionWarrantyMapper.insertMiddleTable(t); }); tRegionWarrantyMapper.update(tRegionWarrantyEntity); return null; return BasicResult.success(); } @Override hd/pipe/secure/src/main/resources/mapping/RegionHazardInformMapper.xml
对比新文件 @@ -0,0 +1,125 @@ <?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.thhy.secure.modules.biz.regionHazardInform.mapper.RegionHazardInformMapper"> <resultMap id="BaseResultMap" type="com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity"> <id column="id" jdbcType="VARCHAR" property="id" /> <result column="region" jdbcType="VARCHAR" property="region" /> <result column="level_type" jdbcType="INTEGER" property="levelType" /> <result column="region_color" jdbcType="VARCHAR" property="regionColor" /> <result column="create_user" jdbcType="VARCHAR" property="createUser" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="company_id" jdbcType="VARCHAR" property="companyId" /> <result column="is_use" jdbcType="INTEGER" property="isUse" /> </resultMap> <insert id="insertTRegionHazardInform" > insert into t_region_hazard_inform <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null"> id, </if> <if test="region != null"> region, </if> <if test="levelType != null"> level_type, </if> <if test="regionColor != null"> region_color, </if> <if test="createTime != null"> create_time, </if> <if test="createUser != null"> create_user, </if> <if test="companyId != null"> company_id, </if> <if test="isUse != null"> is_use, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id!= null"> #{id,jdbcType=VARCHAR}, </if> <if test="region!= null"> #{region,jdbcType=VARCHAR}, </if> <if test="levelType!= null"> #{levelType,jdbcType=INTEGER}, </if> <if test="regionColor!= null"> #{regionColor,jdbcType=VARCHAR}, </if> <if test="createTime!= null"> #{createTime,jdbcType=TIMESTAMP}, </if> <if test="createUser!= null"> #{createUser,jdbcType=VARCHAR}, </if> <if test="companyId!= null"> #{companyId,jdbcType=VARCHAR}, </if> <if test="isUse != null"> #{isUse,jdbcType=INTEGER}, </if> </trim> </insert> <select id="findAllRegionHazardInform" parameterType="com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto" resultType="com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity"> SELECT id, region, level_type, region_color, company_id, create_user, create_time, is_use FROM t_region_hazard_inform WHERE is_use = 1 <if test="companyId!=null and companyId!='' "> and company_id=#{companyId} </if> <if test="levelType!=null and levelType!='' "> and level_type=#{levelType} </if> order by create_time desc </select> <select id="findEntity" parameterType="java.lang.String" resultType="com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity"> SELECT id, region, `level`, region_color, company_id, create_user, create_time, is_use FROM t_region_hazard_inform WHERE is_use = 1 and id = #{id,jdbcType=VARCHAR} </select> <update id="update"> update t_region_hazard_inform <set> <if test="levelType != null"> level_type = #{levelType,jdbcType=INTEGER}, </if> <if test="region != null"> region = #{region,jdbcType=VARCHAR}, </if> <if test="regionColor != null"> region_color = #{regionColor,jdbcType=VARCHAR}, </if> </set> where id = #{id,jdbcType=VARCHAR} </update> <update id="delete" parameterType="java.lang.String"> update t_region_hazard_inform set is_use = 2 where id = #{id,jdbcType=VARCHAR} </update> </mapper> hd/pipe/secure/src/main/resources/mapping/TRegionHazardInformMapper.xml
文件已删除 hd/pipe/secure/src/main/resources/mapping/TRegionWarrantyMapper.xml
@@ -64,7 +64,7 @@ </trim> </insert> <select id="findAll" parameterType="com.thhy.secure.modules.biz.regionWarranty.dto.TRegionWarrantyDto" resultMap="com.thhy.secure.modules.biz.regionWarranty.entity.TRegionWarrantyEntity"> <select id="findAll" parameterType="com.thhy.secure.modules.biz.regionWarranty.dto.TRegionWarrantyDto" resultType="com.thhy.secure.modules.biz.regionWarranty.entity.TRegionWarrantyEntity"> SELECT a.id, a.region_hazard_inform_id regionHazardInformId, @@ -76,7 +76,7 @@ FROM t_region_warranty a LEFT JOIN t_region_hazard_inform b ON b.id = a.region_hazard_inform_id WHERE is_use = 1 WHERE a.is_use = 1 <if test="companyId!=null and companyId!='' "> and a.company_id=#{companyId} </if> @@ -103,13 +103,13 @@ update t_region_warranty <set> <if test="regionHazardInformId != null"> #{regionHazardInformId,jdbcType=VARCHAR}, region_hazard_inform_id = #{regionHazardInformId,jdbcType=VARCHAR}, </if> <if test="riskSourceSituation != null"> #{riskSourceSituation,jdbcType=VARCHAR}, risk_source_situation = #{riskSourceSituation,jdbcType=VARCHAR}, </if> <if test="countermeasures != null"> #{countermeasures,jdbcType=VARCHAR}, countermeasures = #{countermeasures,jdbcType=VARCHAR}, </if> </set> where id = #{id,jdbcType=VARCHAR} @@ -154,7 +154,7 @@ delete from t_region_warranty_user where region_warranty_id = #{id,jdbcType=VARCHAR} </delete> <select id="findMiddleTable" parameterType="java.lang.String" resultType="com.thhy.secure.modules.biz.regionWarranty.entity.TRegionWarrantyUserEntity"> <select id="findMiddleTable" resultType="com.thhy.secure.modules.biz.regionWarranty.entity.TRegionWarrantyUserEntity"> SELECT a.id, a.region_warranty_id regionWarrantyId,