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.

291 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.foreverwin.mesnac.meapi.mapper.InventoryAssyDataMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.InventoryAssyData">
<result column="HANDLE" property="handle" />
<result column="INVENTORY_BO" property="inventoryBo" />
<result column="SEQUENCE" property="sequence" />
<result column="DATA_FIELD" property="dataField" />
<result column="DATA_ATTR" property="dataAttr" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, INVENTORY_BO, SEQUENCE, DATA_FIELD, DATA_ATTR
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM INVENTORY_ASSY_DATA
<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="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM INVENTORY_ASSY_DATA
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM INVENTORY_ASSY_DATA
<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.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</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 INVENTORY_ASSY_DATA
<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.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</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 INVENTORY_ASSY_DATA
<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.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</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 INVENTORY_ASSY_DATA
<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.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</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 INVENTORY_ASSY_DATA
<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.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</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 INVENTORY_ASSY_DATA
<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.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</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.meapi.model.InventoryAssyData">
INSERT INTO INVENTORY_ASSY_DATA
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="inventoryBo!=null">INVENTORY_BO,</if>
<if test="sequence!=null">SEQUENCE,</if>
<if test="dataField!=null">DATA_FIELD,</if>
<if test="dataAttr!=null">DATA_ATTR,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="inventoryBo!=null">#{inventoryBo},</if>
<if test="sequence!=null">#{sequence},</if>
<if test="dataField!=null">#{dataField},</if>
<if test="dataAttr!=null">#{dataAttr},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.InventoryAssyData">
INSERT INTO INVENTORY_ASSY_DATA
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{inventoryBo},
#{sequence},
#{dataField},
#{dataAttr},
</trim>
</insert>
<update id="update">
UPDATE INVENTORY_ASSY_DATA <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.inventoryBo!=null">INVENTORY_BO=#{et.inventoryBo},</if>
<if test="et.sequence!=null">SEQUENCE=#{et.sequence},</if>
<if test="et.dataField!=null">DATA_FIELD=#{et.dataField},</if>
<if test="et.dataAttr!=null">DATA_ATTR=#{et.dataAttr},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</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="deleteByMap">
DELETE FROM INVENTORY_ASSY_DATA
<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 INVENTORY_ASSY_DATA
<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.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</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>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>