WmsBoxInfoMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.ams.box.mapper.WmsBoxInfoMapper">
  6. <resultMap type="WmsBoxInfo" id="WmsBoxInfoResult">
  7. <result property="id" column="id" />
  8. <result property="boxNo" column="box_no" />
  9. <result property="boxType" column="box_type" />
  10. <result property="boxRemark" column="box_remark" />
  11. <result property="boxState" column="box_state" />
  12. <result property="isEmpty" column="is_empty" />
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="updateTime" column="update_time" />
  17. <result property="userdefine1" column="userdefine1" />
  18. <result property="userdefine2" column="userdefine2" />
  19. <result property="locationId" column="location_id" />
  20. <result property="isFull" column="is_full" />
  21. </resultMap>
  22. <sql id="selectWmsBoxInfoVo">
  23. select id, box_no, box_type, box_remark, box_state, is_empty, create_by, create_time, update_by, update_time, userdefine1, userdefine2, location_id, is_full from wms_box_info
  24. </sql>
  25. <select id="selectWmsBoxInfoList" parameterType="WmsBoxInfo" resultMap="WmsBoxInfoResult">
  26. <include refid="selectWmsBoxInfoVo"/>
  27. <where>
  28. <if test="isFull != null and isFull != ''"> and is_full = #{isFull}</if>
  29. <if test="boxNo != null and boxNo != ''"> and box_no = #{boxNo}</if>
  30. </where>
  31. </select>
  32. <select id="selectWmsBoxInfoById" parameterType="Long" resultMap="WmsBoxInfoResult">
  33. <include refid="selectWmsBoxInfoVo"/>
  34. where id = #{id}
  35. </select>
  36. <insert id="insertWmsBoxInfo" parameterType="WmsBoxInfo" useGeneratedKeys="true" keyProperty="id">
  37. insert into wms_box_info
  38. <trim prefix="(" suffix=")" suffixOverrides=",">
  39. <if test="boxNo != null">box_no,</if>
  40. <if test="boxType != null">box_type,</if>
  41. <if test="boxRemark != null">box_remark,</if>
  42. <if test="boxState != null">box_state,</if>
  43. <if test="isEmpty != null">is_empty,</if>
  44. <if test="createBy != null">create_by,</if>
  45. <if test="createTime != null">create_time,</if>
  46. <if test="updateBy != null">update_by,</if>
  47. <if test="updateTime != null">update_time,</if>
  48. <if test="userdefine1 != null">userdefine1,</if>
  49. <if test="userdefine2 != null">userdefine2,</if>
  50. <if test="locationId != null">location_id,</if>
  51. <if test="isFull != null">is_full,</if>
  52. </trim>
  53. <trim prefix="values (" suffix=")" suffixOverrides=",">
  54. <if test="boxNo != null">#{boxNo},</if>
  55. <if test="boxType != null">#{boxType},</if>
  56. <if test="boxRemark != null">#{boxRemark},</if>
  57. <if test="boxState != null">#{boxState},</if>
  58. <if test="isEmpty != null">#{isEmpty},</if>
  59. <if test="createBy != null">#{createBy},</if>
  60. <if test="createTime != null">#{createTime},</if>
  61. <if test="updateBy != null">#{updateBy},</if>
  62. <if test="updateTime != null">#{updateTime},</if>
  63. <if test="userdefine1 != null">#{userdefine1},</if>
  64. <if test="userdefine2 != null">#{userdefine2},</if>
  65. <if test="locationId != null">#{locationId},</if>
  66. <if test="isFull != null">#{isFull},</if>
  67. </trim>
  68. </insert>
  69. <update id="updateWmsBoxInfo" parameterType="WmsBoxInfo">
  70. update wms_box_info
  71. <trim prefix="SET" suffixOverrides=",">
  72. <if test="boxNo != null">box_no = #{boxNo},</if>
  73. <if test="boxType != null">box_type = #{boxType},</if>
  74. <if test="boxRemark != null">box_remark = #{boxRemark},</if>
  75. <if test="boxState != null">box_state = #{boxState},</if>
  76. <if test="isEmpty != null">is_empty = #{isEmpty},</if>
  77. <if test="createBy != null">create_by = #{createBy},</if>
  78. <if test="createTime != null">create_time = #{createTime},</if>
  79. <if test="updateBy != null">update_by = #{updateBy},</if>
  80. <if test="updateTime != null">update_time = #{updateTime},</if>
  81. <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
  82. <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
  83. <if test="locationId != null">location_id = #{locationId},</if>
  84. <if test="isFull != null">is_full = #{isFull},</if>
  85. </trim>
  86. where id = #{id}
  87. </update>
  88. <delete id="deleteWmsBoxInfoById" parameterType="Long">
  89. delete from wms_box_info where id = #{id}
  90. </delete>
  91. <delete id="deleteWmsBoxInfoByIds" parameterType="String">
  92. delete from wms_box_info where id in
  93. <foreach item="id" collection="array" open="(" separator="," close=")">
  94. #{id}
  95. </foreach>
  96. </delete>
  97. <update id="updateLocationBind">
  98. update wms_box_info
  99. <trim prefix="SET" suffixOverrides=",">
  100. <if test="locationTo != null">location_id = #{locationTo},</if>
  101. <if test="isFull != null">is_full = #{isFull},</if>
  102. </trim>
  103. where location_id = #{locationFrom}
  104. </update>
  105. <update id="unbindBox">
  106. update wms_box_info set location_id = '',is_full = 'N'
  107. where location_id = #{locationId}
  108. </update>
  109. <select id="selectWmsBoxInfoByBoxNo" parameterType="string" resultMap="WmsBoxInfoResult">
  110. <include refid="selectWmsBoxInfoVo"/>
  111. where box_no = #{boxNo}
  112. </select>
  113. <select id="selectByLocationId" parameterType="string" resultMap="WmsBoxInfoResult">
  114. <include refid="selectWmsBoxInfoVo"/>
  115. where location_id = #{locationId}
  116. </select>
  117. </mapper>