ftmsorderbillscntrsMapper.xml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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.orderPlan.mapper.FtmsorderbillscntrsMapper">
  6. <resultMap type="ftmsorderbillscntrs" id="ftmsorderbillscntrsResult">
  7. <result property="id" column="id"/>
  8. <result property="pId" column="p_id"/>
  9. <result property="orgId" column="org_id"/>
  10. <result property="cntrId" column="cntr_id"/>
  11. <result property="cntrQty" column="cntr_qty"/>
  12. <result property="cntrPlanQty" column="cntr_plan_qty"/>
  13. <result property="cntrBlcQty" column="cntr_blc_qty"/>
  14. <result property="priceType" column="price_type"/>
  15. <result property="planQty" column="plan_qty"/>
  16. <result property="priceDr" column="price_dr"/>
  17. <result property="planBlcQty" column="plan_blc_qty"/>
  18. <result property="priceCr" column="price_cr"/>
  19. <result property="billStatus" column="bill_status"/>
  20. <result property="delFlag" column="del_flag"/>
  21. <result property="createBy" column="create_by"/>
  22. <result property="createTime" column="create_time"/>
  23. <result property="updateBy" column="update_by"/>
  24. <result property="updateTime" column="update_time"/>
  25. <result property="remarks" column="remarks"/>
  26. </resultMap>
  27. <resultMap type="ftmsorderbillsplans" id="ftmsorderbillsplansResult">
  28. <result property="id" column="id"/>
  29. <result property="pId" column="p_id"/>
  30. <result property="orgId" column="org_id"/>
  31. <result property="cntrId" column="cntr_id"/>
  32. <result property="cntrQty" column="cntr_qty"/>
  33. <result property="carQty" column="car_qty"/>
  34. <result property="carcorPid" column="carcor_pid"/>
  35. <result property="pricecrType" column="pricecr_type"/>
  36. <result property="pricecr" column="pricecr"/>
  37. <result property="ifNeedInvCr" column="if_need_inv_cr"/>
  38. <result property="carnolist" column="carnolist"/>
  39. <result property="planDate" column="plan_date"/>
  40. <result property="planreMarks" column="planre_marks"/>
  41. <result property="acceptDate" column="accept_date"/>
  42. <result property="acceptRemarks" column="accept_remarks"/>
  43. <result property="billStatus" column="bill_status"/>
  44. <result property="delFlag" column="del_flag"/>
  45. <result property="createBy" column="create_by"/>
  46. <result property="createTime" column="create_time"/>
  47. <result property="updateBy" column="update_by"/>
  48. <result property="updateTime" column="update_time"/>
  49. <result property="remarks" column="remarks"/>
  50. </resultMap>
  51. <sql id="selectftmsorderbillscntrsVo">
  52. select id, p_id, org_id, cntr_id, cntr_qty, cntr_plan_qty, cntr_blc_qty, price_type, plan_qty, price_dr, plan_blc_qty, price_cr, bill_status, del_flag, create_by, create_time, update_by, update_time, remarks from F_TMSORDERBILLSCNTRS
  53. </sql>
  54. <select id="selectftmsorderbillscntrsList" parameterType="ftmsorderbillscntrs"
  55. resultMap="ftmsorderbillscntrsResult">
  56. <include refid="selectftmsorderbillscntrsVo"/>
  57. <where>
  58. <if test="pId != null "> and p_id = #{pId}</if>
  59. <if test="orgId != null "> and org_id = #{orgId}</if>
  60. <if test="cntrId != null "> and cntr_id = #{cntrId}</if>
  61. <if test="cntrQty != null "> and cntr_qty = #{cntrQty}</if>
  62. <if test="cntrPlanQty != null "> and cntr_plan_qty = #{cntrPlanQty}</if>
  63. <if test="cntrBlcQty != null "> and cntr_blc_qty = #{cntrBlcQty}</if>
  64. <if test="priceType != null and priceType != ''"> and price_type = #{priceType}</if>
  65. <if test="planQty != null "> and plan_qty = #{planQty}</if>
  66. <if test="priceDr != null "> and price_dr = #{priceDr}</if>
  67. <if test="planBlcQty != null "> and plan_blc_qty = #{planBlcQty}</if>
  68. <if test="priceCr != null "> and price_cr = #{priceCr}</if>
  69. <if test="billStatus != null "> and bill_status = #{billStatus}</if>
  70. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  71. </where>
  72. </select>
  73. <select id="selectftmsorderbillscntrsById" parameterType="Long" resultMap="ftmsorderbillscntrsResult">
  74. <include refid="selectftmsorderbillscntrsVo"/>
  75. where id = #{id}
  76. </select>
  77. <select id="selectftmsorderbillscntrsByPId" parameterType="Long" resultMap="ftmsorderbillscntrsResult">
  78. <include refid="selectftmsorderbillscntrsVo"/>
  79. where p_id = #{id}
  80. </select>
  81. <insert id="insertftmsorderbillscntrs" parameterType="ftmsorderbillscntrs" useGeneratedKeys="true" keyProperty="id">
  82. insert into F_TMSORDERBILLSCNTRS
  83. <trim prefix="(" suffix=")" suffixOverrides=",">
  84. <if test="id != null">id,</if>
  85. <if test="pId != null">p_id,</if>
  86. <if test="orgId != null">org_id,</if>
  87. <if test="cntrId != null">cntr_id,</if>
  88. <if test="cntrQty != null">cntr_qty,</if>
  89. <if test="cntrPlanQty != null">cntr_plan_qty,</if>
  90. <if test="cntrBlcQty != null">cntr_blc_qty,</if>
  91. <if test="priceType != null">price_type,</if>
  92. <if test="planQty != null">plan_qty,</if>
  93. <if test="priceDr != null">price_dr,</if>
  94. <if test="planBlcQty != null">plan_blc_qty,</if>
  95. <if test="priceCr != null">price_cr,</if>
  96. <if test="billStatus != null">bill_status,</if>
  97. <if test="delFlag != null">del_flag,</if>
  98. <if test="createBy != null">create_by,</if>
  99. <if test="createTime != null">create_time,</if>
  100. <if test="updateBy != null">update_by,</if>
  101. <if test="updateTime != null">update_time,</if>
  102. <if test="remarks != null">remarks,</if>
  103. </trim>
  104. <trim prefix="values (" suffix=")" suffixOverrides=",">
  105. <if test="id != null">#{id},</if>
  106. <if test="pId != null">#{pId},</if>
  107. <if test="orgId != null">#{orgId},</if>
  108. <if test="cntrId != null">#{cntrId},</if>
  109. <if test="cntrQty != null">#{cntrQty},</if>
  110. <if test="cntrPlanQty != null">#{cntrPlanQty},</if>
  111. <if test="cntrBlcQty != null">#{cntrBlcQty},</if>
  112. <if test="priceType != null">#{priceType},</if>
  113. <if test="planQty != null">#{planQty},</if>
  114. <if test="priceDr != null">#{priceDr},</if>
  115. <if test="planBlcQty != null">#{planBlcQty},</if>
  116. <if test="priceCr != null">#{priceCr},</if>
  117. <if test="billStatus != null">#{billStatus},</if>
  118. <if test="delFlag != null">#{delFlag},</if>
  119. <if test="createBy != null">#{createBy},</if>
  120. <if test="createTime != null">#{createTime},</if>
  121. <if test="updateBy != null">#{updateBy},</if>
  122. <if test="updateTime != null">#{updateTime},</if>
  123. <if test="remarks != null">#{remarks},</if>
  124. </trim>
  125. </insert>
  126. <update id="updateftmsorderbillscntrs" parameterType="ftmsorderbillscntrs">
  127. update F_TMSORDERBILLSCNTRS
  128. <trim prefix="SET" suffixOverrides=",">
  129. <if test="pId != null">p_id = #{pId},</if>
  130. <if test="orgId != null">org_id = #{orgId},</if>
  131. <if test="cntrId != null">cntr_id = #{cntrId},</if>
  132. <if test="cntrQty != null">cntr_qty = #{cntrQty},</if>
  133. <if test="cntrPlanQty != null">cntr_plan_qty = #{cntrPlanQty},</if>
  134. <if test="cntrBlcQty != null">cntr_blc_qty = #{cntrBlcQty},</if>
  135. <if test="priceType != null">price_type = #{priceType},</if>
  136. <if test="planQty != null">plan_qty = #{planQty},</if>
  137. <if test="priceDr != null">price_dr = #{priceDr},</if>
  138. <if test="planBlcQty != null">plan_blc_qty = #{planBlcQty},</if>
  139. <if test="priceCr != null">price_cr = #{priceCr},</if>
  140. <if test="billStatus != null">bill_status = #{billStatus},</if>
  141. <if test="delFlag != null">del_flag = #{delFlag},</if>
  142. <if test="createBy != null">create_by = #{createBy},</if>
  143. <if test="createTime != null">create_time = #{createTime},</if>
  144. <if test="updateBy != null">update_by = #{updateBy},</if>
  145. <if test="updateTime != null">update_time = #{updateTime},</if>
  146. <if test="remarks != null">remarks = #{remarks},</if>
  147. </trim>
  148. where id = #{id}
  149. </update>
  150. <update id="updateTmsorderbillScntrsQty" parameterType="ftmsorderbillsplans">
  151. update F_TMSORDERBILLSCNTRS
  152. <trim prefix="SET" suffixOverrides=",">
  153. <if test="carQty != null and carQty != 0">cntr_plan_qty = cntr_plan_qty + #{cntrQty},</if>
  154. </trim>
  155. where id = #{id}
  156. </update>
  157. <update id="updateTmsorderCntrStatusByOrgId" parameterType="ftmsorderbillsplans">
  158. update F_TMSORDERBILLSCNTRS
  159. set bill_status = #{billStatus}
  160. where org_id = #{orgId}
  161. </update>
  162. <delete id="deleteftmsorderbillscntrsById" parameterType="Long">
  163. delete from F_TMSORDERBILLSCNTRS where id = #{id}
  164. </delete>
  165. <delete id="deleteftmsorderbillscntrsByPId" parameterType="Long">
  166. delete from F_TMSORDERBILLSCNTRS where p_id = #{id}
  167. </delete>
  168. <delete id="deleteftmsorderbillscntrsByIds" parameterType="String">
  169. delete from F_TMSORDERBILLSCNTRS where id in
  170. <foreach item="id" collection="array" open="(" separator="," close=")">
  171. #{id}
  172. </foreach>
  173. </delete>
  174. </mapper>