PointsMapper.xml 2.5 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">


    <select id="selectEntity" resultType="com.huaheng.pc.config.points.domain.Points">
      SELECT * FROM points where warehouseCode=#{warehouseCode} and goodsShelfNo like CONCAT('%',#{goodsShelfNo},'%')
        <if test="isLocked != null and isLocked != '' ">
            AND isLocked = #{isLocked}
        </if>
    </select>

    <select id="selectFirstEntity" resultType="com.huaheng.pc.config.points.domain.Points">
      SELECT * FROM points
      <where>
          <if test="warehouseCode != null ">
              AND warehouseCode = #{warehouseCode}
          </if>
          <if test="goodsShelfNo != null ">
              AND goodsShelfNo = #{goodsShelfNo}
          </if>
          <if test="isLocked != null ">
              AND isLocked = #{isLocked}
          </if>
          <if test="intX != null and intX != '' ">
              AND intX = #{intX}
          </if>
          <if test="intY != null and intY!='' ">
              AND intY = #{intY}
          </if>
          <if test="oIntX != null ">
              AND oIntX = #{oIntX}
          </if>
          <if test="oIntY != null ">
              AND oIntY = #{oIntY}
          </if>
      </where>
    </select>

    <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>

    <select id="selectShlfno" resultType="java.util.HashMap">
      SELECT goodsShelfNo FROM points where warehouseCode=#{warehouseCode} order by goodsShelfNo asc
    </select>

    <select id="getFirstEntity" resultType="com.huaheng.pc.config.points.domain.Points">
      SELECT * FROM points where isLocked=2 and warehouseCode=#{warehouseCode} order by num asc limit 1
    </select>
    
</mapper>