You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

464 lines
22 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.foreverwin.mesnac.anomaly.mapper.AbnormalNcCodeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.anomaly.model.AbnormalNcCode">
<id column="HANDLE" property="handle"/>
<result column="SITE" property="site"/>
<result column="ABNORMAL_BILL_BO" property="abnormalBillBo"/>
<result column="NC_CODE_GROUP" property="ncCodeGroup"/>
<result column="NC_CODE" property="ncCode"/>
<result column="NC_QTY" property="ncQty"/>
<result column="CREATED_USER" property="createdUser"/>
<result column="CREATED_DATE_TIME" property="createdDateTime"/>
<result column="MODIFIED_USER" property="modifiedUser"/>
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, ABNORMAL_BILL_BO, NC_CODE_GROUP, NC_CODE, NC_QTY, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER,
MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_ABNORMAL_NC_CODE WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"></include>
FROM Z_ABNORMAL_NC_CODE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"></include>
FROM Z_ABNORMAL_NC_CODE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_ABNORMAL_NC_CODE
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null">AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.ncCodeGroup!=null">AND NC_CODE_GROUP=#{ew.entity.ncCodeGroup}</if>
<if test="ew.entity.ncCode!=null">AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null">AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.createdUser!=null">AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null">AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_ABNORMAL_NC_CODE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null">AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.ncCodeGroup!=null">AND NC_CODE_GROUP=#{ew.entity.ncCodeGroup}</if>
<if test="ew.entity.ncCode!=null">AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null">AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.createdUser!=null">AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null">AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_ABNORMAL_NC_CODE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null">AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.ncCodeGroup!=null">AND NC_CODE_GROUP=#{ew.entity.ncCodeGroup}</if>
<if test="ew.entity.ncCode!=null">AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null">AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.createdUser!=null">AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null">AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_ABNORMAL_NC_CODE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null">AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.ncCodeGroup!=null">AND NC_CODE_GROUP=#{ew.entity.ncCodeGroup}</if>
<if test="ew.entity.ncCode!=null">AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null">AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.createdUser!=null">AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null">AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_ABNORMAL_NC_CODE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null">AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.ncCodeGroup!=null">AND NC_CODE_GROUP=#{ew.entity.ncCodeGroup}</if>
<if test="ew.entity.ncCode!=null">AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null">AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.createdUser!=null">AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null">AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_ABNORMAL_NC_CODE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null">AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.ncCodeGroup!=null">AND NC_CODE_GROUP=#{ew.entity.ncCodeGroup}</if>
<if test="ew.entity.ncCode!=null">AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null">AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.createdUser!=null">AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null">AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_ABNORMAL_NC_CODE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null">AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.ncCodeGroup!=null">AND NC_CODE_GROUP=#{ew.entity.ncCodeGroup}</if>
<if test="ew.entity.ncCode!=null">AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null">AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.createdUser!=null">AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null">AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.anomaly.model.AbnormalNcCode">
INSERT INTO Z_ABNORMAL_NC_CODE
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="abnormalBillBo!=null">ABNORMAL_BILL_BO,</if>
<if test="ncCodeGroup!=null">NC_CODE_GROUP,</if>
<if test="ncCode!=null">NC_CODE,</if>
<if test="ncQty!=null">NC_QTY,</if>
<if test="createdUser!=null">CREATED_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifiedUser!=null">MODIFIED_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="abnormalBillBo!=null">#{abnormalBillBo},</if>
<if test="ncCodeGroup!=null">#{ncCodeGroup},</if>
<if test="ncCode!=null">#{ncCode},</if>
<if test="ncQty!=null">#{ncQty},</if>
<if test="createdUser!=null">#{createdUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifiedUser!=null">#{modifiedUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.anomaly.model.AbnormalNcCode">
INSERT INTO Z_ABNORMAL_NC_CODE
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{abnormalBillBo},
#{ncCodeGroup},
#{ncCode},
#{ncQty},
#{createdUser},
#{createdDateTime},
#{modifiedUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_ABNORMAL_NC_CODE
<trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
<if test="et.ncCodeGroup!=null">NC_CODE_GROUP=#{et.ncCodeGroup},</if>
<if test="et.ncCode!=null">NC_CODE=#{et.ncCode},</if>
<if test="et.ncQty!=null">NC_QTY=#{et.ncQty},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim>
WHERE HANDLE=#{et.handle}
<if test="et instanceof java.util.Map">
<if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and
${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
</if>
</if>
</update>
<update id="updateAllColumnById">
UPDATE Z_ABNORMAL_NC_CODE <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
ABNORMAL_BILL_BO=#{et.abnormalBillBo},
NC_CODE_GROUP=#{et.ncCodeGroup},
NC_CODE=#{et.ncCode},
NC_QTY=#{et.ncQty},
CREATED_USER=#{et.createdUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFIED_USER=#{et.modifiedUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle}
<if test="et instanceof java.util.Map">
<if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and
${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
</if>
</if>
</update>
<update id="update">
UPDATE Z_ABNORMAL_NC_CODE
<trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
<if test="et.ncCodeGroup!=null">NC_CODE_GROUP=#{et.ncCodeGroup},</if>
<if test="et.ncCode!=null">NC_CODE=#{et.ncCode},</if>
<if test="et.ncQty!=null">NC_QTY=#{et.ncQty},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null">AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.ncCodeGroup!=null">AND NC_CODE_GROUP=#{ew.entity.ncCodeGroup}</if>
<if test="ew.entity.ncCode!=null">AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null">AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.createdUser!=null">AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null">AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_ABNORMAL_NC_CODE WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_ABNORMAL_NC_CODE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_ABNORMAL_NC_CODE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null">AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.ncCodeGroup!=null">AND NC_CODE_GROUP=#{ew.entity.ncCodeGroup}</if>
<if test="ew.entity.ncCode!=null">AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null">AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.createdUser!=null">AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null">AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_ABNORMAL_NC_CODE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>