203 lines
13 KiB
XML
203 lines
13 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.project.joggle.mapper.OutPtsProductionDetailMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.project.joggle.domain.OutPtsProductionDetail">
|
|
<result property="id" column="ID" jdbcType="VARCHAR"/>
|
|
<result property="action" column="ACTION" jdbcType="DECIMAL"/>
|
|
<result property="parentTraceCode" column="PARENT_TRACE_CODE" jdbcType="VARCHAR"/>
|
|
<result property="parentAppendCode" column="PARENT_APPEND_CODE" jdbcType="VARCHAR"/>
|
|
<result property="productNo" column="PRODUCT_NO" jdbcType="VARCHAR"/>
|
|
<result property="productName" column="PRODUCT_NAME" jdbcType="VARCHAR"/>
|
|
<result property="productSpec" column="PRODUCT_SPEC" jdbcType="VARCHAR"/>
|
|
<result property="packagingRatioName" column="PACKAGING_RATIO_NAME" jdbcType="VARCHAR"/>
|
|
<result property="productionDate" column="PRODUCTION_DATE" jdbcType="VARCHAR"/>
|
|
<result property="productionBatch" column="PRODUCTION_BATCH" jdbcType="VARCHAR"/>
|
|
<result property="expirationDate" column="EXPIRATION_DATE" jdbcType="VARCHAR"/>
|
|
<result property="sourceNo" column="SOURCE_NO" jdbcType="VARCHAR"/>
|
|
<result property="taskNo" column="TASK_NO" jdbcType="VARCHAR"/>
|
|
<result property="lineNo" column="LINE_NO" jdbcType="VARCHAR"/>
|
|
<result property="teamGroupNo" column="TEAM_GROUP_NO" jdbcType="VARCHAR"/>
|
|
<result property="machineNo" column="MACHINE_NO" jdbcType="VARCHAR"/>
|
|
<result property="fuzzy" column="FUZZY" jdbcType="DECIMAL"/>
|
|
<result property="curCode" column="CUR_CODE" jdbcType="VARCHAR"/>
|
|
<result property="scanNo" column="SCAN_NO" jdbcType="DECIMAL"/>
|
|
<result property="layerNo" column="LAYER_NO" jdbcType="DECIMAL"/>
|
|
<result property="status" column="STATUS" jdbcType="VARCHAR"/>
|
|
<result property="inType" column="IN_TYPE" jdbcType="VARCHAR"/>
|
|
<result property="compelete" column="COMPELETE" jdbcType="VARCHAR"/>
|
|
<result property="errorcount" column="ERRORCOUNT" jdbcType="INTEGER"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
ID,ACTION,PARENT_TRACE_CODE,
|
|
PARENT_APPEND_CODE,PRODUCT_NO,PRODUCT_NAME,
|
|
PRODUCT_SPEC,PACKAGING_RATIO_NAME,PRODUCTION_DATE,
|
|
PRODUCTION_BATCH,EXPIRATION_DATE,SOURCE_NO,
|
|
TASK_NO,LINE_NO,TEAM_GROUP_NO,
|
|
MACHINE_NO,FUZZY,CUR_CODE,
|
|
SCAN_NO,LAYER_NO,STATUS,
|
|
IN_TYPE,COMPELETE,ERRORCOUNT
|
|
</sql>
|
|
|
|
<insert id="insert" parameterType="com.project.joggle.domain.OutPtsProductionDetail">
|
|
insert into OUT_PTS_PRODUCTION_DETAIL
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">ID,</if>
|
|
<if test="action != null">ACTION,</if>
|
|
<if test="parentTraceCode != null">PARENT_TRACE_CODE,</if>
|
|
<if test="parentAppendCode != null">PARENT_APPEND_CODE,</if>
|
|
<if test="productNo != null">PRODUCT_NO,</if>
|
|
<if test="productName != null">PRODUCT_NAME,</if>
|
|
<if test="productSpec != null">PRODUCT_SPEC,</if>
|
|
<if test="packagingRatioName != null">PACKAGING_RATIO_NAME,</if>
|
|
<if test="productionDate != null">PRODUCTION_DATE,</if>
|
|
<if test="productionBatch != null">PRODUCTION_BATCH,</if>
|
|
<if test="expirationDate != null">EXPIRATION_DATE,</if>
|
|
<if test="sourceNo != null">SOURCE_NO,</if>
|
|
<if test="taskNo != null">TASK_NO,</if>
|
|
<if test="lineNo != null">LINE_NO,</if>
|
|
<if test="teamGroupNo != null">TEAM_GROUP_NO,</if>
|
|
<if test="machineNo != null">MACHINE_NO,</if>
|
|
<if test="fuzzy != null">FUZZY,</if>
|
|
<if test="curCode != null">CUR_CODE,</if>
|
|
<if test="scanNo != null">SCAN_NO,</if>
|
|
<if test="layerNo != null">LAYER_NO,</if>
|
|
<if test="status != null">STATUS,</if>
|
|
<if test="inType != null">IN_TYPE,</if>
|
|
<if test="compelete != null">COMPELETE,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id,jdbcType=VARCHAR},</if>
|
|
<if test="action != null">#{action,jdbcType=DECIMAL},</if>
|
|
<if test="parentTraceCode != null">#{parentTraceCode,jdbcType=VARCHAR},</if>
|
|
<if test="parentAppendCode != null">#{parentAppendCode,jdbcType=VARCHAR},</if>
|
|
<if test="productNo != null">#{productNo,jdbcType=VARCHAR},</if>
|
|
<if test="productName != null">#{productName,jdbcType=VARCHAR},</if>
|
|
<if test="productSpec != null">#{productSpec,jdbcType=VARCHAR},</if>
|
|
<if test="packagingRatioName != null">#{packagingRatioName,jdbcType=VARCHAR},</if>
|
|
<if test="productionDate != null">#{productionDate,jdbcType=VARCHAR},</if>
|
|
<if test="productionBatch != null">#{productionBatch,jdbcType=VARCHAR},</if>
|
|
<if test="expirationDate != null">#{expirationDate,jdbcType=VARCHAR},</if>
|
|
<if test="sourceNo != null">#{sourceNo,jdbcType=VARCHAR},</if>
|
|
<if test="taskNo != null">#{taskNo,jdbcType=VARCHAR},</if>
|
|
<if test="lineNo != null">#{lineNo,jdbcType=VARCHAR},</if>
|
|
<if test="teamGroupNo != null">#{teamGroupNo,jdbcType=VARCHAR},</if>
|
|
<if test="machineNo != null">#{machineNo,jdbcType=VARCHAR},</if>
|
|
<if test="fuzzy != null">#{fuzzy,jdbcType=DECIMAL},</if>
|
|
<if test="curCode != null">#{curCode,jdbcType=VARCHAR},</if>
|
|
<if test="scanNo != null">#{scanNo,jdbcType=DECIMAL},</if>
|
|
<if test="layerNo != null">#{layerNo,jdbcType=DECIMAL},</if>
|
|
<if test="status != null">#{status,jdbcType=VARCHAR},</if>
|
|
<if test="inType != null">#{inType,jdbcType=VARCHAR},</if>
|
|
<if test="compelete != null">#{compelete,jdbcType=VARCHAR},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<delete id="deleteById" parameterType="java.lang.String">
|
|
delete from OUT_PTS_PRODUCTION_DETAIL where ID = #{id,jdbcType=VARCHAR}
|
|
</delete>
|
|
|
|
<update id="update" parameterType="com.project.joggle.domain.OutPtsProductionDetail">
|
|
update OUT_PTS_PRODUCTION_DETAIL
|
|
<set>
|
|
<if test="action != null">ACTION = #{action,jdbcType=DECIMAL},</if>
|
|
<if test="parentTraceCode != null">PARENT_TRACE_CODE = #{parentTraceCode,jdbcType=VARCHAR},</if>
|
|
<if test="parentAppendCode != null">PARENT_APPEND_CODE = #{parentAppendCode,jdbcType=VARCHAR},</if>
|
|
<if test="productNo != null">PRODUCT_NO = #{productNo,jdbcType=VARCHAR},</if>
|
|
<if test="productName != null">PRODUCT_NAME = #{productName,jdbcType=VARCHAR},</if>
|
|
<if test="productSpec != null">PRODUCT_SPEC = #{productSpec,jdbcType=VARCHAR},</if>
|
|
<if test="packagingRatioName != null">PACKAGING_RATIO_NAME = #{packagingRatioName,jdbcType=VARCHAR},</if>
|
|
<if test="productionDate != null">PRODUCTION_DATE = #{productionDate,jdbcType=VARCHAR},</if>
|
|
<if test="productionBatch != null">PRODUCTION_BATCH = #{productionBatch,jdbcType=VARCHAR},</if>
|
|
<if test="expirationDate != null">EXPIRATION_DATE = #{expirationDate,jdbcType=VARCHAR},</if>
|
|
<if test="sourceNo != null">SOURCE_NO = #{sourceNo,jdbcType=VARCHAR},</if>
|
|
<if test="taskNo != null">TASK_NO = #{taskNo,jdbcType=VARCHAR},</if>
|
|
<if test="lineNo != null">LINE_NO = #{lineNo,jdbcType=VARCHAR},</if>
|
|
<if test="teamGroupNo != null">TEAM_GROUP_NO = #{teamGroupNo,jdbcType=VARCHAR},</if>
|
|
<if test="machineNo != null">MACHINE_NO = #{machineNo,jdbcType=VARCHAR},</if>
|
|
<if test="fuzzy != null">FUZZY = #{fuzzy,jdbcType=DECIMAL},</if>
|
|
<if test="curCode != null">CUR_CODE = #{curCode,jdbcType=VARCHAR},</if>
|
|
<if test="scanNo != null">SCAN_NO = #{scanNo,jdbcType=DECIMAL},</if>
|
|
<if test="layerNo != null">LAYER_NO = #{layerNo,jdbcType=DECIMAL},</if>
|
|
<if test="status != null">STATUS = #{status,jdbcType=VARCHAR},</if>
|
|
<if test="inType != null">IN_TYPE = #{inType,jdbcType=VARCHAR},</if>
|
|
<if test="compelete != null">COMPELETE = #{compelete,jdbcType=VARCHAR},</if>
|
|
</set>
|
|
where ID = #{id,jdbcType=VARCHAR}
|
|
</update>
|
|
|
|
<select id="selectById" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from OUT_PTS_PRODUCTION_DETAIL
|
|
where ID = #{id,jdbcType=VARCHAR}
|
|
</select>
|
|
|
|
<select id="selectList" parameterType="com.project.joggle.domain.OutPtsProductionDetail" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from OUT_PTS_PRODUCTION_DETAIL
|
|
<where>
|
|
<if test="id != null">and ID = #{id,jdbcType=VARCHAR}</if>
|
|
<if test="action != null">and ACTION = #{action,jdbcType=DECIMAL}</if>
|
|
<if test="parentTraceCode != null">and PARENT_TRACE_CODE = #{parentTraceCode,jdbcType=VARCHAR}</if>
|
|
<if test="parentAppendCode != null">and PARENT_APPEND_CODE = #{parentAppendCode,jdbcType=VARCHAR}</if>
|
|
<if test="productNo != null">and PRODUCT_NO = #{productNo,jdbcType=VARCHAR}</if>
|
|
<if test="productName != null">and PRODUCT_NAME = #{productName,jdbcType=VARCHAR}</if>
|
|
<if test="productSpec != null">and PRODUCT_SPEC = #{productSpec,jdbcType=VARCHAR}</if>
|
|
<if test="packagingRatioName != null">and PACKAGING_RATIO_NAME = #{packagingRatioName,jdbcType=VARCHAR}</if>
|
|
<if test="productionDate != null">and PRODUCTION_DATE = #{productionDate,jdbcType=VARCHAR}</if>
|
|
<if test="productionBatch != null">and PRODUCTION_BATCH = #{productionBatch,jdbcType=VARCHAR}</if>
|
|
<if test="expirationDate != null">and EXPIRATION_DATE = #{expirationDate,jdbcType=VARCHAR}</if>
|
|
<if test="sourceNo != null">and SOURCE_NO = #{sourceNo,jdbcType=VARCHAR}</if>
|
|
<if test="taskNo != null">and TASK_NO = #{taskNo,jdbcType=VARCHAR}</if>
|
|
<if test="lineNo != null">and LINE_NO = #{lineNo,jdbcType=VARCHAR}</if>
|
|
<if test="teamGroupNo != null">and TEAM_GROUP_NO = #{teamGroupNo,jdbcType=VARCHAR}</if>
|
|
<if test="machineNo != null">and MACHINE_NO = #{machineNo,jdbcType=VARCHAR}</if>
|
|
<if test="fuzzy != null">and FUZZY = #{fuzzy,jdbcType=DECIMAL}</if>
|
|
<if test="curCode != null">and CUR_CODE = #{curCode,jdbcType=VARCHAR}</if>
|
|
<if test="scanNo != null">and SCAN_NO = #{scanNo,jdbcType=DECIMAL}</if>
|
|
<if test="layerNo != null">and LAYER_NO = #{layerNo,jdbcType=DECIMAL}</if>
|
|
<if test="status != null">and STATUS = #{status,jdbcType=VARCHAR}</if>
|
|
<if test="inType != null">and IN_TYPE = #{inType,jdbcType=VARCHAR}</if>
|
|
<if test="compelete != null">and COMPELETE = #{compelete,jdbcType=VARCHAR}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectTopOutProductionDetail" resultMap="BaseResultMap">
|
|
SELECT * FROM (
|
|
SELECT
|
|
<include refid="Base_Column_List" />
|
|
FROM OUT_PTS_PRODUCTION_DETAIL
|
|
WHERE STATUS in (0,2)
|
|
and (ERRORCOUNT is null or ERRORCOUNT < 3)
|
|
) WHERE ROWNUM = 1
|
|
</select>
|
|
|
|
<select id="selectOutPtsProductionDetailByParentAppendCode" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from OUT_PTS_PRODUCTION_DETAIL
|
|
where PARENT_APPEND_CODE = #{parentAppendCode} and status in (0,2) and SOURCE_NO =#{sourceNo}
|
|
</select>
|
|
|
|
<update id="updateStatusByParentAppendCode" parameterType="string">
|
|
update OUT_PTS_PRODUCTION_DETAIL set status = #{status} where parent_append_code = #{parentAppendCode} and source_no = #{sourceNo} and status in (0,2)
|
|
</update>
|
|
|
|
<update id="updateOutPtsProductionDetailByOrderNo" parameterType="string">
|
|
update OUT_PTS_PRODUCTION_DETAIL set status =#{status} where parent_append_code = #{parentAppendCode} and status>0
|
|
</update>
|
|
|
|
<delete id="deleteOutPtsProductionDetailByParentAppendCode" parameterType="string">
|
|
delete from OUT_PTS_PRODUCTION_DETAIL where parent_append_code = #{parentAppendCode} and source_no = #{sourceNo} and status=1
|
|
</delete>
|
|
|
|
<update id="updateErrorcountByParentAppendCode" parameterType="com.project.joggle.domain.OutPtsProductionDetail">
|
|
update OUT_PTS_PRODUCTION_DETAIL set errorcount = #{errorcount} where parent_append_code = #{parentAppendCode} and source_no = #{sourceNo} and status in (0,2)
|
|
</update>
|
|
</mapper>
|