WmsBoxInfoMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. </where>
  30. </select>
  31. <select id="selectWmsBoxInfoById" parameterType="Long" resultMap="WmsBoxInfoResult">
  32. <include refid="selectWmsBoxInfoVo"/>
  33. where id = #{id}
  34. </select>
  35. <insert id="insertWmsBoxInfo" parameterType="WmsBoxInfo" useGeneratedKeys="true" keyProperty="id">
  36. insert into wms_box_info
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="boxNo != null">box_no,</if>
  39. <if test="boxType != null">box_type,</if>
  40. <if test="boxRemark != null">box_remark,</if>
  41. <if test="boxState != null">box_state,</if>
  42. <if test="isEmpty != null">is_empty,</if>
  43. <if test="createBy != null">create_by,</if>
  44. <if test="createTime != null">create_time,</if>
  45. <if test="updateBy != null">update_by,</if>
  46. <if test="updateTime != null">update_time,</if>
  47. <if test="userdefine1 != null">userdefine1,</if>
  48. <if test="userdefine2 != null">userdefine2,</if>
  49. <if test="locationId != null">location_id,</if>
  50. <if test="isFull != null">is_full,</if>
  51. </trim>
  52. <trim prefix="values (" suffix=")" suffixOverrides=",">
  53. <if test="boxNo != null">#{boxNo},</if>
  54. <if test="boxType != null">#{boxType},</if>
  55. <if test="boxRemark != null">#{boxRemark},</if>
  56. <if test="boxState != null">#{boxState},</if>
  57. <if test="isEmpty != null">#{isEmpty},</if>
  58. <if test="createBy != null">#{createBy},</if>
  59. <if test="createTime != null">#{createTime},</if>
  60. <if test="updateBy != null">#{updateBy},</if>
  61. <if test="updateTime != null">#{updateTime},</if>
  62. <if test="userdefine1 != null">#{userdefine1},</if>
  63. <if test="userdefine2 != null">#{userdefine2},</if>
  64. <if test="locationId != null">#{locationId},</if>
  65. <if test="isFull != null">#{isFull},</if>
  66. </trim>
  67. </insert>
  68. <update id="updateWmsBoxInfo" parameterType="WmsBoxInfo">
  69. update wms_box_info
  70. <trim prefix="SET" suffixOverrides=",">
  71. <if test="boxNo != null">box_no = #{boxNo},</if>
  72. <if test="boxType != null">box_type = #{boxType},</if>
  73. <if test="boxRemark != null">box_remark = #{boxRemark},</if>
  74. <if test="boxState != null">box_state = #{boxState},</if>
  75. <if test="isEmpty != null">is_empty = #{isEmpty},</if>
  76. <if test="createBy != null">create_by = #{createBy},</if>
  77. <if test="createTime != null">create_time = #{createTime},</if>
  78. <if test="updateBy != null">update_by = #{updateBy},</if>
  79. <if test="updateTime != null">update_time = #{updateTime},</if>
  80. <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
  81. <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
  82. <if test="locationId != null">location_id = #{locationId},</if>
  83. <if test="isFull != null">is_full = #{isFull},</if>
  84. </trim>
  85. where id = #{id}
  86. </update>
  87. <delete id="deleteWmsBoxInfoById" parameterType="Long">
  88. delete from wms_box_info where id = #{id}
  89. </delete>
  90. <delete id="deleteWmsBoxInfoByIds" parameterType="String">
  91. delete from wms_box_info where id in
  92. <foreach item="id" collection="array" open="(" separator="," close=")">
  93. #{id}
  94. </foreach>
  95. </delete>
  96. <update id="updateLocationBind">
  97. update wms_box_info
  98. <trim prefix="SET" suffixOverrides=",">
  99. <if test="locationId != null">location_id = #{locationTo},</if>
  100. <if test="isFull != null">is_full = #{isFull},</if>
  101. </trim>
  102. where location_id = #{locationFrom}
  103. </update>
  104. <update id="unbindBox">
  105. update wms_box_info set location_id = '',is_full = 'N'
  106. where location_id = #{locationId}
  107. </update>
  108. </mapper>