PointsMapper.xml 2.45 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.points.mapper.PointsMapper">
    <resultMap id="BaseResultMap" type="com.huaheng.pc.config.points.domain.Points">
        <!--@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="goodsShelfNo" jdbcType="VARCHAR" property="goodsShelfNo" />
        <result column="intX" jdbcType="VARCHAR" property="intX" />
        <result column="intY" jdbcType="VARCHAR" property="intY" />
        <result column="oIntX" jdbcType="VARCHAR" property="oIntX" />
        <result column="oIntY" jdbcType="VARCHAR" property="oIntY" />
        <result column="num" jdbcType="INTEGER" property="num" />
        <result column="isEmpty" jdbcType="INTEGER" property="isEmpty" />
        <result column="isEnable" jdbcType="INTEGER" property="isEnable" />
        <result column="isLocked" jdbcType="INTEGER" property="isLocked" />
    </resultMap>
    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        warehouseCode,companyCode,goodsShelfNo,intX,intY,oIntX,oIntY,num,isEmpty,isEnable,isLocked
    </sql>


    <update id="updatePoints">
         UPDATE points
         <set>
        <if test="isLocked != null">
            isLocked = #{isLocked, jdbcType=INTEGER},
        </if>
        <if test="intX != null">
            intX = #{intX, jdbcType=VARCHAR},
        </if>
        <if test="intY != null">
            intY = #{intY, jdbcType=VARCHAR},
        </if>
        <if test="oIntX != null">
            oIntX = #{oIntX, jdbcType=VARCHAR},
        </if>
        <if test="oIntY != null">
              oIntY = #{oIntY, jdbcType=VARCHAR},
        </if>
        <if test="num != null">
            num = #{num, jdbcType=INTEGER},
        </if>
        </set>
        where goodsShelfNo=#{goodsShelfNo} and warehouseCode=#{warehouseCode}
    </update>



    <update id="updateAll">
        update points set isLocked = 0
    </update>


    <update id="updateIsEmpty">
        update points set isEmpty = #{isEmpty}
        WHERE goodsShelfNo IN
        <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
            #{item}
        </foreach>

    </update>
</mapper>