From 9b63b9770cd02ca73c20196a3e02f971bc6e70e8 Mon Sep 17 00:00:00 2001 From: 刘小明 <liuxm_a@163.com> Date: 星期五, 26 七月 2024 17:39:21 +0800 Subject: [PATCH] mapper 及xml整理 --- pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java | 3 + pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java | 3 + pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml | 4 +- pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltStationMapper.java | 2 pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml | 56 ++++++++++++++-------------- pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductionLineMapper.java | 3 + pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaPrivilegeMapper.java | 2 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrDevOpsPlanMapper.java | 3 + pms-parent/pms-global/src/main/resources/mapper/PrProductionProcessMapper.xml | 2 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrAssemblyPlanMapper.java | 5 +- pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml | 10 ++-- pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml | 2 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionProcessMapper.java | 3 + pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml | 8 ++-- pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml | 4 +- 15 files changed, 58 insertions(+), 52 deletions(-) diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaPrivilegeMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaPrivilegeMapper.java index de69388..3836c35 100644 --- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaPrivilegeMapper.java +++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaPrivilegeMapper.java @@ -24,7 +24,7 @@ Long selectSomeCount(Map<String, Object> params); - List<BaPrivilege> selectByIds(List<String> ids) ; + List<BaPrivilege> selectByIds(@Param("ids") List<String> ids) ; /** * 鏌ヨ鏌愪釜鐢ㄦ埛鎵�闅跺睘鎵�鏈夎鑹茬殑鎵�鏈夋潈闄� diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java index 3defdb5..40a34b3 100644 --- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java +++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java @@ -2,6 +2,7 @@ import com.dy.pmsGlobal.pojoPlt.PltProduct; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -24,7 +25,7 @@ String selectMaxCode(); - boolean exists(String name, Long id); + boolean exists(@Param("name") String name, @Param("id") Long id); PltProduct selectByCode(String productCode); } \ No newline at end of file diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductionLineMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductionLineMapper.java index 5434162..5777468 100644 --- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductionLineMapper.java +++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductionLineMapper.java @@ -2,6 +2,7 @@ import com.dy.pmsGlobal.pojoPlt.PltProductionLine; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -22,7 +23,7 @@ int insertSelective(PltProductionLine record); PltProductionLine selectByPrimaryKey(Long id); - Long selectByNameId(Long id,String name); + Long selectByNameId(@Param("id") Long id, @Param("name") String name); int updateByPrimaryKeySelective(PltProductionLine record); diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltStationMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltStationMapper.java index 45dffb1..b10aae3 100644 --- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltStationMapper.java +++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltStationMapper.java @@ -39,5 +39,5 @@ List<PltStation> selectStationList(PltStation record); - long selectByLineAndStatus(Long lineId, boolean disabled); + long selectByLineAndStatus(@Param("lineId") Long lineId, @Param("disabled") boolean disabled); } diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrAssemblyPlanMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrAssemblyPlanMapper.java index bdeb8d8..07d5ee1 100644 --- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrAssemblyPlanMapper.java +++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrAssemblyPlanMapper.java @@ -2,6 +2,7 @@ import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -33,9 +34,9 @@ int deleteLogicById(Long id); - boolean exists(String name, Long id); + boolean exists(@Param("name") String name, @Param("id") Long id); - PrAssemblyPlan selectByDeviceNo(String proCode, String batchNumber); + PrAssemblyPlan selectByDeviceNo(@Param("proCode") String proCode,@Param("batchNumber") String batchNumber); List<PrAssemblyPlan> selectAssyPlanList(PrAssemblyPlan params); diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrDevOpsPlanMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrDevOpsPlanMapper.java index d5f042f..2f17b8d 100644 --- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrDevOpsPlanMapper.java +++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrDevOpsPlanMapper.java @@ -2,6 +2,7 @@ import com.dy.pmsGlobal.pojoPr.PrDevOpsPlan; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -33,5 +34,5 @@ int deleteLogicById(Long id); - boolean exists(String name, Long id); + boolean exists(@Param("name") String name, @Param("id") Long id); } diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java index 51a18a6..92d49e0 100644 --- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java +++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java @@ -2,6 +2,7 @@ import com.dy.pmsGlobal.pojoPr.PrProductionNode; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -24,7 +25,7 @@ int updateByPrimaryKeySelective(PrProductionNode record); - List<PrProductionNode> selectByProcess(Long processId); + List<PrProductionNode> selectByProcess(@Param("processId") Long processId); void deleteByProcessId(Long id); diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionProcessMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionProcessMapper.java index 321c4da..252db23 100644 --- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionProcessMapper.java +++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionProcessMapper.java @@ -3,6 +3,7 @@ import com.dy.pmsGlobal.pojoPr.PrProductionProcess; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -33,5 +34,5 @@ @MapKey("id") List<Map<String,String>> queryAll(Long proId); - boolean exists(String name, Long id); + boolean exists(@Param("name") String name,@Param("id") Long id); } diff --git a/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml index 64e3777..df8f57d 100644 --- a/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml +++ b/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml @@ -40,9 +40,9 @@ <!--@mbg.generated--> id, `name`, phone, `password`, supper_admin, disabled, deleted, create_dt </sql> - <sql id="part_Column_List"> + <sql id="part_Column_List"><![CDATA[ ${alias}.id, ${alias}.name, ${alias}.phone, ${alias}.password, ${alias}.disabled,${alias}.create_dt - </sql> + ]]></sql> <sql id="Login_Column_List"> id, name, phone, supper_admin </sql> diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml index 7ed3144..f56de7d 100644 --- a/pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml +++ b/pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml @@ -62,7 +62,7 @@ dt,start_date,end_date, deleted,content,input_number,output_number </sql> - <sql id="part_Column_List"> + <sql id="part_Column_List" > ${alias}.id, ${alias}.pro_id, ${alias}.batch_id, @@ -265,7 +265,7 @@ <if test="endDate != null">#{endDate,jdbcType=VARCHAR},</if> <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> <if test="content != null">#{content,jdbcType=VARCHAR},</if> - <if test="inputNumber != null">#{intputNumber,jdbcType=INTEGER},</if> + <if test="inputNumber != null">#{inputNumber,jdbcType=INTEGER},</if> <if test="outputNumber != null">#{outputNumber,jdbcType=INTEGER},</if> </trim> </insert> diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml index 581d229..e80217e 100644 --- a/pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml +++ b/pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml @@ -52,7 +52,7 @@ <if test="id != null">#{id,jdbcType=BIGINT},</if> <if test="proId != null">#{proId,jdbcType=BIGINT},</if> <if test="batchId != null">#{batchId,jdbcType=BIGINT},</if> - <if test="deviceNo != null">#{deviceNo</if> + <if test="deviceNo != null">#{deviceNo},</if> <if test="status != null">#{status,jdbcType=TINYINT},</if> </trim> </insert> @@ -79,10 +79,10 @@ batch_id = #{batchId,jdbcType=BIGINT}, </if> <if test="deviceNo != null"> - device_no = #{deviceNo + device_no = #{deviceNo}, </if> <if test="status != null"> - status = #{status,jdbcType=TINYINT}, + status = #{status,jdbcType=TINYINT} </if> </set> where id = #{id,jdbcType=BIGINT} @@ -92,7 +92,7 @@ set pro_id = #{proId,jdbcType=BIGINT}, batch_id = #{batchId,jdbcType=BIGINT}, - device_no = #{deviceNo + device_no = #{deviceNo}, status = #{status,jdbcType=TINYINT} where id = #{id,jdbcType=BIGINT} </update> diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml index c737c4c..3f4fd0e 100644 --- a/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml +++ b/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml @@ -154,11 +154,11 @@ </if> </trim> order by sort asc - <trim prefix="limit " > - <if test="start != null and count != null"> - #{start}, #{count} - </if> - </trim> +<!-- <trim prefix="limit " >--> +<!-- <if test="start != null and count != null">--> +<!-- #{start}, #{count}--> +<!-- </if>--> +<!-- </trim>--> </select> <select id="isEndNode" resultType="java.lang.Boolean"> select diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrProductionProcessMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrProductionProcessMapper.xml index 0386a6a..30cd75a 100644 --- a/pms-parent/pms-global/src/main/resources/mapper/PrProductionProcessMapper.xml +++ b/pms-parent/pms-global/src/main/resources/mapper/PrProductionProcessMapper.xml @@ -156,7 +156,7 @@ <!-- </if>--> </trim> </select> - <select id="queryAll" resultType="map"> + <select id="queryAll" resultType="java.util.List"> select CAST(id AS CHAR) AS id,name from pr_production_process diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml index bfd33b8..0bd9d4d 100644 --- a/pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml +++ b/pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml @@ -71,7 +71,7 @@ node_id,work_type,dt,status, start_time,end_time,assistants </sql> - <sql id="part_Column_List"> + <sql id="part_Column_List"><![CDATA[ ${alias}.id, ${alias}.user_id, ${alias}.line_id, @@ -85,7 +85,7 @@ ${alias}.start_time, ${alias}.end_time, ${alias}.assistants - </sql> + ]]></sql> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> @@ -93,29 +93,29 @@ where id = #{id,jdbcType=BIGINT} </select> - <select id="selectByUserAndStation" resultMap="BaseResultMap"> - select - <include refid="Base_Column_List"/> - from plt_station where status ==1 - <trim prefix="and" suffixOverrides="and"> - <if test="id != null and id !=''"> - id = #{id,jdbcType=BIGINT} and - </if> - <if test="code != null and code !=''"> - code = #{code,jdbcType=VARCHAR} and - </if> - <if test="name != null and name !=''"> - name like concat('%', #{name}, '%') and - </if> - <if test="disabled != null and disabled !=''"> - disabled = #{disabled,jdbcType=TINYINT} and - </if> - <if test="lineId != null and lineId !=''"> - line_id = #{lineId,jdbcType=BIGINT} and - </if> - </trim> - order by id desc - </select> +<!-- <select id="selectByUserAndStation" resultMap="BaseResultMap">--> +<!-- select--> +<!-- <include refid="Base_Column_List"/>--> +<!-- from plt_station where status =1--> +<!-- <trim prefix="and" suffixOverrides="and">--> +<!-- <if test="id != null and id !=''">--> +<!-- id = #{id,jdbcType=BIGINT} and--> +<!-- </if>--> +<!-- <if test="code != null and code !=''">--> +<!-- code = #{code,jdbcType=VARCHAR} and--> +<!-- </if>--> +<!-- <if test="name != null and name !=''">--> +<!-- name like concat('%', #{name}, '%') and--> +<!-- </if>--> +<!-- <if test="disabled != null and disabled !=''">--> +<!-- disabled = #{disabled,jdbcType=TINYINT} and--> +<!-- </if>--> +<!-- <if test="lineId != null and lineId !=''">--> +<!-- line_id = #{lineId,jdbcType=BIGINT} and--> +<!-- </if>--> +<!-- </trim>--> +<!-- order by id desc--> +<!-- </select>--> <select id="selectList" resultMap="BaseResultMap"> select @@ -144,10 +144,10 @@ and status = #{status,jdbcType=TINYINT} </if> <if test="startTime != null and startTime !=''"> - and start_time = #{startTime,jdbcType=TIMESTAMP}, + and start_time = #{startTime,jdbcType=TIMESTAMP} </if> <if test="endTime != null and endTime !=''"> - and end_time = #{endTime,jdbcType=TIMESTAMP}, + and end_time = #{endTime,jdbcType=TIMESTAMP} </if> <if test="assistants != null and assistants !=''"> and assistants = #{assistants,jdbcType=VARCHAR} @@ -190,7 +190,7 @@ and p.name like concat('%', #{planName}, '%') </if> <if test="processName != null and processName != '' "> - and pp.name like concat('%', #{processName}, '%') + and ppp.name like concat('%', #{processName}, '%') </if> <if test="nodeName != null and nodeName != '' "> and n.content like concat('%', #{nodeName}, '%') diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml index 858c844..82399da 100644 --- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml +++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml @@ -39,7 +39,7 @@ curr_node,node_content,device_cycle_content, status,result, error_msg,assistants, - updated_by,in_time,out_time, + updated_by,in_time,out_time,in_line_time,out_line_time, memo </sql> <select id="selectByDeviceNo" parameterType="java.lang.String" resultMap="joinResultMap"> -- Gitblit v1.8.0