PointPositionMapper.xml 2.18 KB
<?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.huaheng.pc.config.pointPosition.mapper.PointPositionMapper">
    <resultMap id="BaseResultMap" type="com.huaheng.pc.config.pointPosition.domain.PointPosition">
        <!--@mbg.generated-->
        <id column="id" jdbcType="INTEGER" property="id" />
        <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" />
        <result column="companyCode" jdbcType="VARCHAR" property="companyCode" />
        <result column="positionName" jdbcType="VARCHAR" property="positionName" />
        <result column="status" jdbcType="VARCHAR" property="status" />
        <result column="enable" jdbcType="VARCHAR" property="enable" />
        <result column="created" jdbcType="VARCHAR" property="created" />
        <result column="createdBy" jdbcType="VARCHAR" property="createdBy" />
        <result column="locationCode" jdbcType="VARCHAR" property="locationCode" />
        <result column="containerCode" jdbcType="VARCHAR" property="containerCode" />
        <result column="updated" jdbcType="TIMESTAMP" property="updated" />
    </resultMap>
    <update id="updateStatus">
        UPDATE point_position set `status`=#{status} WHERE warehouseCode=#{warehouseCode} AND `positionName`=#{positionName}
    </update>

    <update id="setContainerCode">
        UPDATE point_position set `containerCode`=#{containerCode} WHERE warehouseCode=#{warehouseCode} AND `positionName`=#{positionName}
    </update>

    <insert id="addList" parameterType="com.huaheng.pc.config.pointPosition.domain.PointPosition" keyProperty="id" useGeneratedKeys="true" >
        INSERT INTO point_position(
        positionName,
        warehouseCode,
        status,
        created,
        updated,
        enable
        )values
        <foreach collection="containers" item="item" index="index" separator=",">
            (
            #{item.positionName},
            #{item.warehouseCode},
            #{item.status},
            #{item.created},
            #{item.updated},
            #{item.enable}
            )
        </foreach>
    </insert>

</mapper>