RingScanInformationFirstMapper.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.zkqy.amichi.mapper.RingScanInformationFirstMapper">
  6. <resultMap type="com.zkqy.amichi.domain.RingScanInformationFirst" id="RingScanInformationFirstResult">
  7. <result property="id" column="id" />
  8. <result property="orderNumber" column="order_number" />
  9. <result property="productionOrderNumber" column="production_order_number" />
  10. <result property="status" column="status" />
  11. <result property="startTime" column="start_time" />
  12. <result property="endTime" column="end_time" />
  13. <result property="packingQuantity" column="packing_quantity" />
  14. <result property="inspectionQuantity" column="inspection_quantity" />
  15. <result property="totalQuantity" column="total_quantity" />
  16. <result property="packingOrInspection" column="packing_or_inspection" />
  17. <result property="productionOrderTotalQuantity" column="production_order_total_quantity" />
  18. </resultMap>
  19. <sql id="selectRingScanInformationFirstVo">
  20. select id, order_number, production_order_number, status,start_time,end_time,packing_quantity,inspection_quantity,total_quantity,
  21. packing_or_inspection,production_order_total_quantity
  22. from fjqydb.ring_scan_information_first
  23. </sql>
  24. <select id="selectRingScanInformationFirstList" parameterType="com.zkqy.amichi.domain.RingScanInformationFirst" resultMap="RingScanInformationFirstResult">
  25. <include refid="selectRingScanInformationFirstVo"/>
  26. <where>
  27. <if test="orderNumber != null and orderNumber != ''"> and (order_number = #{orderNumber} or production_order_number = #{orderNumber})</if>
  28. <if test="productionOrderNumber != null and productionOrderNumber != ''"> and production_order_number = #{productionOrderNumber}</if>
  29. <if test="status != null and status != ''"> and status = #{status}</if>
  30. <if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
  31. <if test="endTime != null and endTime != ''"> and end_time = #{endTime}</if>
  32. <if test="packingQuantity != null and packingQuantity != ''"> and packing_quantity = #{packingQuantity}</if>
  33. <if test="inspectionQuantity != null and inspectionQuantity != ''"> and inspection_quantity = #{inspectionQuantity}</if>
  34. <if test="totalQuantity != null and totalQuantity != ''"> and total_quantity = #{totalQuantity}</if>
  35. <if test="packingOrInspection != null and packingOrInspection != ''"> and packing_or_inspection = #{packingOrInspection}</if>
  36. </where>
  37. </select>
  38. <select id="selectRingScanInformationFirstById" parameterType="Long" resultMap="RingScanInformationFirstResult">
  39. <include refid="selectRingScanInformationFirstVo"/>
  40. where id = #{id}
  41. </select>
  42. <insert id="insertRingScanInformationFirst" parameterType="com.zkqy.amichi.domain.RingScanInformationFirst" useGeneratedKeys="true" keyProperty="id">
  43. insert into fjqydb.ring_scan_information_first
  44. <trim prefix="(" suffix=")" suffixOverrides=",">
  45. <if test="orderNumber != null">order_number,</if>
  46. <if test="productionOrderNumber != null">production_order_number,</if>
  47. <if test="status != null">status,</if>
  48. <if test="startTime != null">start_time,</if>
  49. <if test="endTime != null">end_time,</if>
  50. <if test="packingQuantity != null and packingQuantity != ''">packing_quantity,</if>
  51. <if test="inspectionQuantity != null and inspectionQuantity != ''">inspection_quantity,</if>
  52. <if test="totalQuantity != null and totalQuantity != ''">total_quantity,</if>
  53. <if test="packingOrInspection != null and packingOrInspection != ''">packing_or_inspection,</if>
  54. <if test="productionOrderTotalQuantity != null and productionOrderTotalQuantity != ''">production_order_total_quantity,</if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="orderNumber != null">#{orderNumber},</if>
  58. <if test="productionOrderNumber != null">#{productionOrderNumber},</if>
  59. <if test="status != null">#{status},</if>
  60. <if test="startTime != null">#{startTime},</if>
  61. <if test="endTime != null">#{endTime},</if>
  62. <if test="packingQuantity != null and packingQuantity != ''">#{packingQuantity},</if>
  63. <if test="inspectionQuantity != null and inspectionQuantity != ''">#{inspectionQuantity},</if>
  64. <if test="totalQuantity != null and totalQuantity != ''">#{totalQuantity},</if>
  65. <if test="packingOrInspection != null and packingOrInspection != ''">#{packingOrInspection},</if>
  66. <if test="productionOrderTotalQuantity != null and productionOrderTotalQuantity != ''">#{productionOrderTotalQuantity}</if>
  67. </trim>
  68. </insert>
  69. <update id="updateRingScanInformationFirst" parameterType="com.zkqy.amichi.domain.RingScanInformationFirst">
  70. update fjqydb.ring_scan_information_first
  71. <trim prefix="SET" suffixOverrides=",">
  72. <if test="orderNumber != null">order_number = #{orderNumber},</if>
  73. <if test="productionOrderNumber != null">production_order_number = #{productionOrderNumber},</if>
  74. <if test="status != null">status = #{status},</if>
  75. <if test="startTime != null and startTime != ''">start_time = #{startTime}</if>
  76. <if test="endTime != null and endTime != ''">end_time = #{endTime}</if>
  77. <if test="packingQuantity != null and packingQuantity != ''"> packing_quantity = #{packingQuantity}</if>
  78. <if test="inspectionQuantity != null and inspectionQuantity != ''">inspection_quantity = #{inspectionQuantity}</if>
  79. <if test="totalQuantity != null and totalQuantity != ''">total_quantity = #{totalQuantity}</if>
  80. </trim>
  81. where id = #{id}
  82. </update>
  83. <update id="updateRingScanInformationFirstByproductionOrderNumber" parameterType="com.zkqy.amichi.domain.RingScanInformationFirst">
  84. update fjqydb.ring_scan_information_first
  85. <trim prefix="SET" suffixOverrides=",">
  86. <if test="orderNumber != null">order_number = #{orderNumber},</if>
  87. <if test="productionOrderNumber != null">production_order_number = #{productionOrderNumber},</if>
  88. <if test="status != null">status = #{status},</if>
  89. <if test="startTime != null and startTime != ''">start_time = #{startTime}</if>
  90. <if test="endTime != null and endTime != ''">end_time = #{endTime}</if>
  91. <if test="packingQuantity != null and packingQuantity != ''"> packing_quantity = #{packingQuantity}</if>
  92. <if test="inspectionQuantity != null and inspectionQuantity != ''">inspection_quantity = #{inspectionQuantity}</if>
  93. <if test="totalQuantity != null and totalQuantity != ''">total_quantity = #{totalQuantity}</if>
  94. </trim>
  95. where production_order_number = #{productionOrderNumber}
  96. </update>
  97. <delete id="deleteRingScanInformationFirstById" parameterType="Long">
  98. delete from fjqydb.ring_scan_information_first where id = #{id}
  99. </delete>
  100. <delete id="deleteRingScanInformationFirstByIds" parameterType="String">
  101. delete from fjqydb.ring_scan_information_first where id in
  102. <foreach item="id" collection="array" open="(" separator="," close=")">
  103. #{id}
  104. </foreach>
  105. </delete>
  106. </mapper>