pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductTestInspectionItemsMapper.java
New file @@ -0,0 +1,36 @@ package com.dy.pmsGlobal.daoPlt; import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems; import org.apache.ibatis.annotations.Mapper; import java.util.List; import java.util.Map; /** * @author User * @description 针对表【plt_product_test_inspection_items(产品测试检查项目表)】的数据库操作Mapper * @createDate 2024-06-19 09:05:53 * @Entity com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems */ @Mapper public interface PltProductTestInspectionItemsMapper { int deleteByPrimaryKey(Long id); int insert(PltProductTestInspectionItems record); int insertSelective(PltProductTestInspectionItems record); PltProductTestInspectionItems selectByPrimaryKey(Long id); int updateByPrimaryKeySelective(PltProductTestInspectionItems record); int updateByPrimaryKey(PltProductTestInspectionItems record); Long selectSomeCount(Map<String,Object> params); List<PltProductTestInspectionItems> selectSome(Map<String,Object> params); int deleteLogicById(Long id); } pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltProductTestInspectionItems.java
File was renamed from pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltProductTestItems.java @@ -15,15 +15,15 @@ /** * 产品测试检查项目表 * @TableName plt_product_test_items * @TableName plt_product_test_inspection_items */ @TableName(value ="plt_product_test_items" , autoResultMap = true) @TableName(value ="plt_product_test_inspection_items", autoResultMap = true) @Data @Builder @ToString @NoArgsConstructor @AllArgsConstructor public class PltProductTestItems implements BaseEntity { public class PltProductTestInspectionItems implements BaseEntity { /** * */ @@ -37,8 +37,6 @@ @JSONField(serializeUsing= ObjectWriterImplToString.class) @NotNull(message = "产品实体编号不能为空") public Long proId; /** * 测试项目 @@ -60,6 +58,5 @@ /** * 排序 */ public Integer sort; } pms-parent/pms-global/src/main/resources/mapper/PltProductTestInspectionItemsMapper.xml
File was renamed from pms-parent/pms-global/src/main/resources/mapper/PltProductTestItemsMapper.xml @@ -2,9 +2,9 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.dy.pmsGlobal.daoPlt.PltProductTestItemsMapper"> <mapper namespace="com.dy.pmsGlobal.daoPlt.PltProductTestInspectionItemsMapper"> <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPlt.PltProductTestItems"> <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems"> <id property="id" column="id" jdbcType="BIGINT"/> <result property="proId" column="pro_id" jdbcType="BIGINT"/> <result property="item" column="item" jdbcType="VARCHAR"/> @@ -21,13 +21,13 @@ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from plt_product_test_items from plt_product_test_inspection_items where id = #{id,jdbcType=BIGINT} </select> <select id="selectSomeCount" resultType="java.lang.Long"> select count(1) from plt_product_test_items t from plt_product_test_inspection_items t where t.deleted!=1 <trim prefix="and" suffixOverrides="and"> <if test="proId != null and proId != ''"> @@ -42,7 +42,7 @@ <select id="selectSome" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from plt_product_test_items t from plt_product_test_inspection_items t where t.deleted!=1 <trim prefix="and" suffixOverrides="and"> <if test="proId != null and proId != ''"> @@ -60,13 +60,12 @@ </trim> </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> delete from plt_product_test_items delete from plt_product_test_inspection_items where id = #{id,jdbcType=BIGINT} </delete> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductTestItems" useGeneratedKeys="true"> insert into plt_product_test_items <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems" useGeneratedKeys="true"> insert into plt_product_test_inspection_items ( id,pro_id,item ,deleted,disabled,sort ) @@ -74,8 +73,8 @@ ,#{deleted,jdbcType=TINYINT},#{disabled,jdbcType=TINYINT},#{sort,jdbcType=INTEGER} ) </insert> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductTestItems" useGeneratedKeys="true"> insert into plt_product_test_items <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems" useGeneratedKeys="true"> insert into plt_product_test_inspection_items <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="proId != null">pro_id,</if> @@ -93,8 +92,8 @@ <if test="sort != null">#{sort,jdbcType=INTEGER},</if> </trim> </insert> <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductTestItems"> update plt_product_test_items <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems"> update plt_product_test_inspection_items <set> <if test="proId != null"> pro_id = #{proId,jdbcType=BIGINT}, @@ -114,8 +113,8 @@ </set> where id = #{id,jdbcType=BIGINT} </update> <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductTestItems"> update plt_product_test_items <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems"> update plt_product_test_inspection_items set pro_id = #{proId,jdbcType=BIGINT}, item = #{item,jdbcType=VARCHAR}, @@ -125,7 +124,7 @@ where id = #{id,jdbcType=BIGINT} </update> <update id="deleteLogicById" parameterType="java.lang.Long"> update plt_product_test_items set deleted = 1 update plt_product_test_inspection_items set deleted = 1 where id = #{id} </update> </mapper> pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proTestItems/ProTestItemsCtrl.java
@@ -6,10 +6,8 @@ import com.dy.common.webUtil.BaseResponseUtils; import com.dy.common.webUtil.QueryResultVo; import com.dy.pmsGlobal.aop.Log; import com.dy.pmsGlobal.pojoPlt.PltProductTestItems; import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems; import com.dy.pmsGlobal.pojoPlt.PltProductUnqualifiedReason; import com.dy.pmsPlatform.proTestItems.ProTestItemsSv; import com.dy.pmsPlatform.proTestItems.QueryVo; import jakarta.validation.Valid; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -38,7 +36,7 @@ @PostMapping(path="save") @SsoPowerAop(power = "10300003") @Log("保存产品品质检查项目信息") public BaseResponse<Boolean> save(@RequestBody @Valid PltProductTestItems item){ public BaseResponse<Boolean> save(@RequestBody @Valid PltProductTestInspectionItems item){ item.deleted = false; item.disabled = false; int count =sv.save(item); @@ -58,7 +56,7 @@ @PostMapping(path="update") @SsoPowerAop(power = "10300003") @Log("更新产品品质检查项目信息") public BaseResponse<Boolean> update(@RequestBody @Valid PltProductTestItems item){ public BaseResponse<Boolean> update(@RequestBody @Valid PltProductTestInspectionItems item){ int count = sv.update(item); if (count <= 0) { return BaseResponseUtils.buildFail("数据库存储失败"); @@ -94,8 +92,8 @@ @GetMapping(path="one") @SsoPowerAop(power = "10300002") //登录与权限同时验证 @Log("根据ID查询产品品质检查项目信息") public BaseResponse<PltProductTestItems> one(String id){ PltProductTestItems item=sv.selectById(id); public BaseResponse<PltProductTestInspectionItems> one(String id){ PltProductTestInspectionItems item=sv.selectById(id); return BaseResponseUtils.buildSuccess(JSON.toJSON(item)); } @@ -107,8 +105,8 @@ @PostMapping(path="some") @SsoPowerAop(power = "10300002") @Log("查询产品品质检查项目信息") public BaseResponse<QueryResultVo<List<PltProductTestItems>>> some(@RequestBody QueryVo vo){ QueryResultVo<List<PltProductTestItems>> list = sv.selectSome(vo) ; public BaseResponse<QueryResultVo<List<PltProductTestInspectionItems>>> some(@RequestBody QueryVo vo){ QueryResultVo<List<PltProductTestInspectionItems>> list = sv.selectSome(vo) ; return BaseResponseUtils.buildSuccess(list); } /** pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proTestItems/ProTestItemsSv.java
@@ -1,9 +1,8 @@ package com.dy.pmsPlatform.proTestItems; import com.dy.common.webUtil.QueryResultVo; import com.dy.pmsGlobal.daoPlt.PltProductTestItemsMapper; import com.dy.pmsGlobal.pojoPlt.PltProductTestItems; import com.dy.pmsPlatform.proTestItems.QueryVo; import com.dy.pmsGlobal.daoPlt.PltProductTestInspectionItemsMapper; import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.stereotype.Service; @@ -14,14 +13,14 @@ @Slf4j @Service public class ProTestItemsSv { private final PltProductTestItemsMapper dao; private final PltProductTestInspectionItemsMapper dao; public ProTestItemsSv(PltProductTestItemsMapper dao) { public ProTestItemsSv(PltProductTestInspectionItemsMapper dao) { this.dao = dao; } @Transactional public int save(PltProductTestItems item) { public int save(PltProductTestInspectionItems item) { int count = dao.insertSelective(item); return count; } @@ -39,26 +38,26 @@ @Transactional public int update(PltProductTestItems item) { public int update(PltProductTestInspectionItems item) { int count = dao.updateByPrimaryKeySelective(item); return count; } public PltProductTestItems selectById(String paramId) { public PltProductTestInspectionItems selectById(String paramId) { return dao.selectByPrimaryKey(Long.valueOf(paramId)); } /** * 获取列表 */ public QueryResultVo<List<PltProductTestItems>> selectSome(QueryVo queryVo) { public QueryResultVo<List<PltProductTestInspectionItems>> selectSome(QueryVo queryVo) { Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); //查询符合条件的记录总数 Long itemTotal = this.dao.selectSomeCount(params); QueryResultVo<List<PltProductTestItems>> rsVo = new QueryResultVo<>(queryVo.pageSize, queryVo.pageCurr) ; QueryResultVo<List<PltProductTestInspectionItems>> rsVo = new QueryResultVo<>(queryVo.pageSize, queryVo.pageCurr) ; //计算分页等信息 rsVo.calculateAndSet(itemTotal, params); @@ -69,7 +68,7 @@ @Transactional public int disabled(Long id, Boolean disabled) { PltProductTestItems item = new PltProductTestItems(); PltProductTestInspectionItems item = new PltProductTestInspectionItems(); item.setId(id); item.setDisabled(disabled); return dao.updateByPrimaryKeySelective(item);