From 76b5e34bccb723c3d414b3d981ed8b00b79411d8 Mon Sep 17 00:00:00 2001 From: 邱宇豪 <qyh123230312> Date: 星期三, 27 九月 2023 17:28:11 +0800 Subject: [PATCH] 调整区域包保 --- /dev/null | 125 --------------- hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/dto/TRegionWarrantyDto.java | 1 hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/TRegionHazardInformService.java | 8 hd/pipe/secure/src/main/resources/mapping/TRegionWarrantyMapper.xml | 12 hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/dto/TRegionHazardInformDto.java | 2 hd/pipe/secure/src/main/resources/mapping/RegionHazardInformMapper.xml | 125 +++++++++++++++ hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/mapper/RegionHazardInformMapper.java | 28 +++ hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/impl/TRegionHazardInformServiceImpl.java | 24 +- hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/entity/RegionHazardInformEntity.java | 84 ++++++++++ hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/service/impl/TRegionWarrantyServiceImpl.java | 8 hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/controller/TRegionHazardInformController.java | 16 - hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/entity/TRegionHazardInformEntity.java | 8 12 files changed, 277 insertions(+), 164 deletions(-) diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/controller/TRegionHazardInformController.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/controller/TRegionHazardInformController.java index 5f0b0dd..4bb476d 100644 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/controller/TRegionHazardInformController.java +++ b/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); } } diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/dto/TRegionHazardInformDto.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/dto/TRegionHazardInformDto.java index 51f18f1..b8b4c5e 100644 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/dto/TRegionHazardInformDto.java +++ b/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; diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/entity/RegionHazardInformEntity.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/entity/RegionHazardInformEntity.java new file mode 100644 index 0000000..399ea2c --- /dev/null +++ b/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; + } +} diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/entity/TRegionHazardInformEntity.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/entity/TRegionHazardInformEntity.java index 33fae80..4acaa95 100644 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/entity/TRegionHazardInformEntity.java +++ b/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; diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/mapper/RegionHazardInformMapper.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/mapper/RegionHazardInformMapper.java new file mode 100644 index 0000000..14a88a8 --- /dev/null +++ b/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); +} diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/mapper/TRegionHazardInformMapper.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/mapper/TRegionHazardInformMapper.java deleted file mode 100644 index ecdc93a..0000000 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/mapper/TRegionHazardInformMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.thhy.secure.modules.biz.regionHazardInform.mapper; - -import com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto; -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 TRegionHazardInformMapper { - - List<TRegionHazardInformEntity> findAll(TRegionHazardInformDto tRegionHazardInformDto); - - TRegionHazardInformEntity findEntity(String id); - - void insert(TRegionHazardInformEntity tRegionHazardInformEntity); - - void update(TRegionHazardInformEntity tRegionHazardInformEntity); - - void delete(String id); -} diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/TRegionHazardInformService.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/TRegionHazardInformService.java index 8b51ec1..7d5a093 100644 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/TRegionHazardInformService.java +++ b/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); } diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/impl/TRegionHazardInformServiceImpl.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/impl/TRegionHazardInformServiceImpl.java index 157bf98..075b4b1 100644 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionHazardInform/service/impl/TRegionHazardInformServiceImpl.java +++ b/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(); } diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/dto/TRegionWarrantyDto.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/dto/TRegionWarrantyDto.java index d4145cb..055154c 100644 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/dto/TRegionWarrantyDto.java +++ b/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; } diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/service/impl/TRegionWarrantyServiceImpl.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/service/impl/TRegionWarrantyServiceImpl.java index 649e8a3..65e8b4d 100644 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionWarranty/service/impl/TRegionWarrantyServiceImpl.java +++ b/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 diff --git a/hd/pipe/secure/src/main/resources/mapping/RegionHazardInformMapper.xml b/hd/pipe/secure/src/main/resources/mapping/RegionHazardInformMapper.xml new file mode 100644 index 0000000..28d775f --- /dev/null +++ b/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> \ No newline at end of file diff --git a/hd/pipe/secure/src/main/resources/mapping/TRegionHazardInformMapper.xml b/hd/pipe/secure/src/main/resources/mapping/TRegionHazardInformMapper.xml deleted file mode 100644 index 19e8fa0..0000000 --- a/hd/pipe/secure/src/main/resources/mapping/TRegionHazardInformMapper.xml +++ /dev/null @@ -1,125 +0,0 @@ -<?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.TRegionHazardInformMapper"> - <resultMap id="BaseResultMap" type="com.thhy.secure.modules.biz.regionHazardInform.entity.TRegionHazardInformEntity"> - <!-- - WARNING - @mbg.generated - This element is automatically generated by MyBatis Generator, do not modify. - This element was generated on Fri Jun 02 10:07:36 CST 2023. - --> - <id column="id" jdbcType="VARCHAR" property="id" /> - <result column="region" jdbcType="VARCHAR" property="region" /> - <result column="level" jdbcType="INTEGER" property="level" /> - <result column="region_color" jdbcType="VARCHAR" property="regionColor" /> - <result column="company_id" jdbcType="VARCHAR" property="companyId" /> - <result column="create_user" jdbcType="VARCHAR" property="createUser" /> - <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> - </resultMap> - - - <insert id="insert" > - insert into t_region_hazard_inform - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> - <if test="region != null"> - region, - </if> - <if test="level != null"> - `level`, - </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> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=VARCHAR}, - </if> - <if test="region != null"> - #{region,jdbcType=VARCHAR}, - </if> - <if test="level != null"> - #{level,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> - </trim> - </insert> - <select id="findAll" parameterType="com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto" resultMap="BaseResultMap"> - SELECT - id, - region, - `level`, - 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="level!=null and level!='' "> - and `level`=#{level} - </if> - order by create_time desc - </select> - <select id="findEntity" parameterType="java.lang.String" resultType="com.thhy.secure.modules.biz.regionHazardInform.entity.TRegionHazardInformEntity"> - 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="level != null"> - level = #{level,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> - <delete id="delete"> - update t_region_hazard_inform set is_use = 2 where id = #{id,jdbcType=VARCHAR} - </delete> -</mapper> \ No newline at end of file diff --git a/hd/pipe/secure/src/main/resources/mapping/TRegionWarrantyMapper.xml b/hd/pipe/secure/src/main/resources/mapping/TRegionWarrantyMapper.xml index 7c4cda3..f327add 100644 --- a/hd/pipe/secure/src/main/resources/mapping/TRegionWarrantyMapper.xml +++ b/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, -- Gitblit v1.9.3