141 lines
8.4 KiB
XML
141 lines
8.4 KiB
XML
<?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.ktg.mes.md.mapper.BaseTechnologyBomMapper">
|
|
|
|
<resultMap type="BaseTechnologyBom" id="BaseTechnologyBomResult">
|
|
<result property="technologyBomId" column="TECHNOLOGY_BOM_ID" />
|
|
<result property="figureCode" column="FIGURE_CODE" />
|
|
<result property="processCode" column="PROCESS_CODE" />
|
|
<result property="processName" column="PROCESS_NAME" />
|
|
<result property="knifeCode" column="KNIFE_CODE" />
|
|
<result property="knifeSort" column="KNIFE_SORT" />
|
|
<result property="knifeCount" column="KNIFE_COUNT" />
|
|
<result property="expendLife" column="EXPEND_LIFE" />
|
|
<result property="lockedStartTime" column="LOCKED_START_TIME" />
|
|
<result property="lockedEndTime" column="LOCKED_END_TIME" />
|
|
<result property="remark" column="REMARK" />
|
|
<result property="attr1" column="ATTR1" />
|
|
<result property="attr2" column="ATTR2" />
|
|
<result property="attr3" column="ATTR3" />
|
|
<result property="attr4" column="ATTR4" />
|
|
<result property="createBy" column="CREATE_BY" />
|
|
<result property="createTime" column="CREATE_TIME" />
|
|
<result property="updateBy" column="UPDATE_BY" />
|
|
<result property="updateTime" column="UPDATE_TIME" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBaseTechnologyBomVo">
|
|
select TECHNOLOGY_BOM_ID, FIGURE_CODE, PROCESS_CODE, PROCESS_NAME, KNIFE_CODE, KNIFE_SORT, KNIFE_COUNT, EXPEND_LIFE, LOCKED_START_TIME, LOCKED_END_TIME, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from BASE_TECHNOLOGY_BOM
|
|
</sql>
|
|
|
|
<select id="selectBaseTechnologyBomList" parameterType="BaseTechnologyBom" resultMap="BaseTechnologyBomResult">
|
|
<include refid="selectBaseTechnologyBomVo"/>
|
|
<where>
|
|
<if test="figureCode != null and figureCode != ''"> and FIGURE_CODE = #{figureCode}</if>
|
|
<if test="processCode != null and processCode != ''"> and PROCESS_CODE = #{processCode}</if>
|
|
<if test="processName != null and processName != ''"> and PROCESS_NAME like concat('%', #{processName}, '%')</if>
|
|
<if test="knifeCode != null and knifeCode != ''"> and KNIFE_CODE = #{knifeCode}</if>
|
|
<if test="knifeSort != null and knifeSort != ''"> and KNIFE_SORT = #{knifeSort}</if>
|
|
<if test="knifeCount != null and knifeCount != ''"> and KNIFE_COUNT = #{knifeCount}</if>
|
|
<if test="expendLife != null and expendLife != ''"> and EXPEND_LIFE = #{expendLife}</if>
|
|
<if test="lockedStartTime != null and lockedStartTime != ''"> and LOCKED_START_TIME = #{lockedStartTime}</if>
|
|
<if test="lockedEndTime != null and lockedEndTime != ''"> and LOCKED_END_TIME = #{lockedEndTime}</if>
|
|
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
|
|
<if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if>
|
|
<if test="attr2 != null and attr2 != ''"> and ATTR2 = #{attr2}</if>
|
|
<if test="attr3 != null and attr3 != ''"> and ATTR3 = #{attr3}</if>
|
|
<if test="attr4 != null and attr4 != ''"> and ATTR4 = #{attr4}</if>
|
|
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
|
|
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
|
|
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectBaseTechnologyBomByTechnologyBomId" parameterType="String" resultMap="BaseTechnologyBomResult">
|
|
<include refid="selectBaseTechnologyBomVo"/>
|
|
where TECHNOLOGY_BOM_ID = #{technologyBomId}
|
|
</select>
|
|
|
|
<insert id="insertBaseTechnologyBom" parameterType="BaseTechnologyBom" useGeneratedKeys="true" keyProperty="technologyBomId">
|
|
insert into BASE_TECHNOLOGY_BOM
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="figureCode != null">FIGURE_CODE,</if>
|
|
<if test="processCode != null">PROCESS_CODE,</if>
|
|
<if test="processName != null">PROCESS_NAME,</if>
|
|
<if test="knifeCode != null">KNIFE_CODE,</if>
|
|
<if test="knifeSort != null">KNIFE_SORT,</if>
|
|
<if test="knifeCount != null">KNIFE_COUNT,</if>
|
|
<if test="expendLife != null">EXPEND_LIFE,</if>
|
|
<if test="lockedStartTime != null">LOCKED_START_TIME,</if>
|
|
<if test="lockedEndTime != null">LOCKED_END_TIME,</if>
|
|
<if test="remark != null">REMARK,</if>
|
|
<if test="attr1 != null">ATTR1,</if>
|
|
<if test="attr2 != null">ATTR2,</if>
|
|
<if test="attr3 != null">ATTR3,</if>
|
|
<if test="attr4 != null">ATTR4,</if>
|
|
<if test="createBy != null">CREATE_BY,</if>
|
|
<if test="createTime != null">CREATE_TIME,</if>
|
|
<if test="updateBy != null">UPDATE_BY,</if>
|
|
<if test="updateTime != null">UPDATE_TIME,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="figureCode != null">#{figureCode},</if>
|
|
<if test="processCode != null">#{processCode},</if>
|
|
<if test="processName != null">#{processName},</if>
|
|
<if test="knifeCode != null">#{knifeCode},</if>
|
|
<if test="knifeSort != null">#{knifeSort},</if>
|
|
<if test="knifeCount != null">#{knifeCount},</if>
|
|
<if test="expendLife != null">#{expendLife},</if>
|
|
<if test="lockedStartTime != null">#{lockedStartTime},</if>
|
|
<if test="lockedEndTime != null">#{lockedEndTime},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
<if test="attr2 != null">#{attr2},</if>
|
|
<if test="attr3 != null">#{attr3},</if>
|
|
<if test="attr4 != null">#{attr4},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBaseTechnologyBom" parameterType="BaseTechnologyBom">
|
|
update BASE_TECHNOLOGY_BOM
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="figureCode != null">FIGURE_CODE = #{figureCode},</if>
|
|
<if test="processCode != null">PROCESS_CODE = #{processCode},</if>
|
|
<if test="processName != null">PROCESS_NAME = #{processName},</if>
|
|
<if test="knifeCode != null">KNIFE_CODE = #{knifeCode},</if>
|
|
<if test="knifeSort != null">KNIFE_SORT = #{knifeSort},</if>
|
|
<if test="knifeCount != null">KNIFE_COUNT = #{knifeCount},</if>
|
|
<if test="expendLife != null">EXPEND_LIFE = #{expendLife},</if>
|
|
<if test="lockedStartTime != null">LOCKED_START_TIME = #{lockedStartTime},</if>
|
|
<if test="lockedEndTime != null">LOCKED_END_TIME = #{lockedEndTime},</if>
|
|
<if test="remark != null">REMARK = #{remark},</if>
|
|
<if test="attr1 != null">ATTR1 = #{attr1},</if>
|
|
<if test="attr2 != null">ATTR2 = #{attr2},</if>
|
|
<if test="attr3 != null">ATTR3 = #{attr3},</if>
|
|
<if test="attr4 != null">ATTR4 = #{attr4},</if>
|
|
<if test="createBy != null">CREATE_BY = #{createBy},</if>
|
|
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
|
|
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
|
|
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
|
|
</trim>
|
|
where TECHNOLOGY_BOM_ID = #{technologyBomId}
|
|
</update>
|
|
|
|
<delete id="deleteBaseTechnologyBomByTechnologyBomId" parameterType="String">
|
|
delete from BASE_TECHNOLOGY_BOM where TECHNOLOGY_BOM_ID = #{technologyBomId}
|
|
</delete>
|
|
|
|
<delete id="deleteBaseTechnologyBomByTechnologyBomIds" parameterType="String">
|
|
delete from BASE_TECHNOLOGY_BOM where TECHNOLOGY_BOM_ID in
|
|
<foreach item="technologyBomId" collection="array" open="(" separator="," close=")">
|
|
#{technologyBomId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |