TWarehouseAgreementMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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.warehouseBusiness.mapper.TWarehouseAgreementMapper">
  6. <resultMap type="TWarehouseAgreement" id="TWarehouseAgreementResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fBillno" column="f_billno"/>
  9. <result property="fContractno" column="f_contractno"/>
  10. <result property="fDeptid" column="f_deptid"/>
  11. <result property="fCorpid" column="f_corpid"/>
  12. <result property="fGoodsid" column="f_goodsid"/>
  13. <result property="fStltypeid" column="f_stltypeid"/>
  14. <result property="fFeetypeid" column="f_feetypeid"/>
  15. <result property="tPackages" column="t_packages"/>
  16. <result property="fTrademodeid" column="f_trademodeid"/>
  17. <result property="fFreedays" column="f_freedays"/>
  18. <result property="fBegindate" column="f_begindate"/>
  19. <result property="fEnddate" column="f_enddate"/>
  20. <result property="fBillstatus" column="f_billstatus"/>
  21. <result property="fStatus" column="f_status"/>
  22. <result property="delFlag" column="del_flag"/>
  23. <result property="createBy" column="create_by"/>
  24. <result property="createTime" column="create_time"/>
  25. <result property="updateBy" column="update_by"/>
  26. <result property="updateTime" column="update_time"/>
  27. <result property="remark" column="remark"/>
  28. <result property="fTaskType" column="f_task_type"/>
  29. <result property="fDc" column="f_dc"/>
  30. <result property="fBilltype" column="f_billtype"/>
  31. <result property="fBilltypeName" column="f_billtype_name"/>
  32. </resultMap>
  33. <sql id="selectTWarehouseAgreementVo">
  34. select f_id, f_billno,f_contractno, f_deptid, f_corpid,f_goodsid, f_stltypeid, f_feetypeid, t_packages, f_trademodeid, f_freedays, f_begindate, f_enddate, f_billstatus,f_status, del_flag, create_by, create_time, update_by, update_time, remark,f_task_type,f_dc,f_billtype,f_billtype_name from t_warehouse_agreement
  35. </sql>
  36. <select id="selectTWarehouseAgreementList" parameterType="TWarehouseAgreement"
  37. resultMap="TWarehouseAgreementResult">
  38. <include refid="selectTWarehouseAgreementVo"/>
  39. <where>
  40. <if test="fBillno != null and fBillno != ''">and f_billno = #{fBillno}</if>
  41. <if test="fContractno != null and fContractno != ''">and f_contractno = #{fContractno}</if>
  42. <if test="fDeptid != null ">and f_deptid = #{fDeptid}</if>
  43. <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
  44. <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
  45. <if test="fStltypeid != null ">and f_stltypeid = #{fStltypeid}</if>
  46. <if test="fFeetypeid != null ">and f_feetypeid = #{fFeetypeid}</if>
  47. <if test="tPackages != null and tPackages != ''">and t_packages = #{tPackages}</if>
  48. <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
  49. <if test="fFreedays != null ">and f_freedays = #{fFreedays}</if>
  50. <if test="fBegindate != null ">and f_begindate = #{fBegindate}</if>
  51. <if test="fEnddate != null ">and f_enddate = #{fEnddate}</if>
  52. <if test="fTaskType != null ">and f_task_type = #{fTaskType}</if>
  53. <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
  54. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  55. <if test="fBilltype != null and fBilltype != ''">and f_billtype like concat('%', #{fBilltype}, '%')</if>
  56. <if test="fBilltypeName != null and fBilltypeName != ''">and f_billtype_name like concat('%', #{fBilltypeName}, '%')</if>
  57. </where>
  58. </select>
  59. <select id="selectTWarehouseAgreementList1" parameterType="TWarehouseAgreement"
  60. resultType="Map" >
  61. SELECT DISTINCT
  62. agre.f_id AS fId,
  63. corp.f_name AS fCorpid,
  64. agre.f_contractno AS fContractno,
  65. goods.f_id AS fGoodsid,
  66. goods.f_name AS fGoodsids,
  67. agre.t_packages AS tPackages,
  68. agre.f_begindate AS fBegindate,
  69. agre.f_enddate AS fEnddate,
  70. agre.f_feetypeid AS fFeetypeid,
  71. agre.f_billstatus AS fBillstatus,
  72. agre.f_status AS fStatus,
  73. agre.f_task_type AS fTaskType,
  74. agre.f_dc AS fDc,
  75. agre.f_billtype_name AS fBilltypeName
  76. FROM
  77. t_warehouse_agreement agre
  78. LEFT JOIN t_corps corp ON corp.f_id = agre.f_corpid
  79. LEFT JOIN t_goods goods ON goods.f_id = agre.f_goodsid
  80. <where>
  81. <if test="fBillno != null and fBillno != ''">and agre.f_billno = #{fBillno}</if>
  82. <if test="fContractno != null and fContractno != ''">and agre.f_contractno = #{fContractno}</if>
  83. <if test="fDeptid != null ">and agre.f_deptid = #{fDeptid}</if>
  84. <if test="fCorpid != null ">and agre.f_corpid = #{fCorpid}</if>
  85. <if test="fGoodsid != null">and agre.f_goodsid = #{fGoodsid}</if>
  86. <if test="fStltypeid != null ">and agre.f_stltypeid = #{fStltypeid}</if>
  87. <if test="fFeetypeid != null ">and agre.f_feetypeid = #{fFeetypeid}</if>
  88. <if test="tPackages != null and tPackages != ''">and agre.t_packages = #{tPackages}</if>
  89. <if test="fTrademodeid != null ">and agre.f_trademodeid = #{fTrademodeid}</if>
  90. <if test="fFreedays != null ">and agre.f_freedays = #{fFreedays}</if>
  91. <if test="fBegindate != null ">and agre.f_begindate = #{fBegindate}</if>
  92. <if test="fTaskType != null ">and agre.f_task_type = #{fTaskType}</if>
  93. <if test="fDc != null ">and agre.f_dc = #{fDc}</if>
  94. <if test="fEnddate != null ">and agre.f_enddate = #{fEnddate}</if>
  95. <if test="fBillstatus != null and fBillstatus != ''">and agre.f_billstatus = #{fBillstatus}</if>
  96. <if test="fStatus != null and fStatus != ''">and agre.f_status = #{fStatus}</if>
  97. <if test="fBilltype != null and fBilltype != ''">and agre.f_billtype like concat('%', #{fBilltype}, '%')</if>
  98. <if test="fBilltypeName != null and fBilltypeName != ''">and agre.f_billtype_name like concat('%', #{fBilltypeName}, '%')</if>
  99. </where>
  100. </select>
  101. <select id="selectTWarehouseAgreementById" parameterType="Long" resultMap="TWarehouseAgreementResult">
  102. <include refid="selectTWarehouseAgreementVo"/>
  103. where f_id = #{fId}
  104. </select>
  105. <insert id="insertTWarehouseAgreement" parameterType="TWarehouseAgreement" useGeneratedKeys="true"
  106. keyProperty="fId">
  107. insert into t_warehouse_agreement
  108. <trim prefix="(" suffix=")" suffixOverrides=",">
  109. <if test="fBillno != null and fBillno != ''">f_billno,</if>
  110. <if test="fContractno != null and fContractno != ''">f_contractno,</if>
  111. <if test="fDeptid != null">f_deptid,</if>
  112. <if test="fCorpid != null">f_corpid,</if>
  113. <if test="fGoodsid != null">f_goodsid,</if>
  114. <if test="fStltypeid != null">f_stltypeid,</if>
  115. <if test="fFeetypeid != null">f_feetypeid,</if>
  116. <if test="tPackages != null">t_packages,</if>
  117. <if test="fTrademodeid != null">f_trademodeid,</if>
  118. <if test="fFreedays != null">f_freedays,</if>
  119. <if test="fBegindate != null">f_begindate,</if>
  120. <if test="fEnddate != null">f_enddate,</if>
  121. <if test="fBillstatus != null">f_billstatus,</if>
  122. <if test="fStatus != null">f_status,</if>
  123. <if test="delFlag != null">del_flag,</if>
  124. <if test="createBy != null">create_by,</if>
  125. <if test="createTime != null">create_time,</if>
  126. <if test="updateBy != null">update_by,</if>
  127. <if test="updateTime != null">update_time,</if>
  128. <if test="remark != null">remark,</if>
  129. <if test="fTaskType != null">f_task_type,</if>
  130. <if test="fDc != null">f_dc,</if>
  131. <if test="fBilltype != null">f_billtype,</if>
  132. <if test="fBilltypeName != null">f_billtype_name,</if>
  133. </trim>
  134. <trim prefix="values (" suffix=")" suffixOverrides=",">
  135. <if test="fBillno != null and fBillno != ''">#{fBillno},</if>
  136. <if test="fContractno != null and fContractno != ''">#{fContractno},</if>
  137. <if test="fDeptid != null">#{fDeptid},</if>
  138. <if test="fCorpid != null">#{fCorpid},</if>
  139. <if test="fGoodsid != null">#{fGoodsid},</if>
  140. <if test="fStltypeid != null">#{fStltypeid},</if>
  141. <if test="fFeetypeid != null">#{fFeetypeid},</if>
  142. <if test="tPackages != null">#{tPackages},</if>
  143. <if test="fTrademodeid != null">#{fTrademodeid},</if>
  144. <if test="fFreedays != null">#{fFreedays},</if>
  145. <if test="fBegindate != null">#{fBegindate},</if>
  146. <if test="fEnddate != null">#{fEnddate},</if>
  147. <if test="fBillstatus != null">#{fBillstatus},</if>
  148. <if test="fStatus != null">#{fStatus},</if>
  149. <if test="delFlag != null">#{delFlag},</if>
  150. <if test="createBy != null">#{createBy},</if>
  151. <if test="createTime != null">#{createTime},</if>
  152. <if test="updateBy != null">#{updateBy},</if>
  153. <if test="updateTime != null">#{updateTime},</if>
  154. <if test="remark != null">#{remark},</if>
  155. <if test="fTaskType != null">#{fTaskType},</if>
  156. <if test="fDc != null">#{fDc},</if>
  157. <if test="fBilltype != null">#{fBilltype},</if>
  158. <if test="fBilltypeName != null">#{fBilltypeName},</if>
  159. </trim>
  160. </insert>
  161. <update id="updateTWarehouseAgreement" parameterType="TWarehouseAgreement">
  162. update t_warehouse_agreement
  163. <trim prefix="SET" suffixOverrides=",">
  164. <if test="fBillno != null and fBillno != ''">f_billno = #{fBillno},</if>
  165. <if test="fContractno != null and fContractno != ''">f_contractno = #{fContractno},</if>
  166. <if test="fDeptid != null">f_deptid = #{fDeptid},</if>
  167. <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
  168. <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
  169. <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
  170. <if test="fFeetypeid != null">f_feetypeid = #{fFeetypeid},</if>
  171. <if test="tPackages != null">t_packages = #{tPackages},</if>
  172. <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
  173. <if test="fFreedays != null">f_freedays = #{fFreedays},</if>
  174. <if test="fBegindate != null">f_begindate = #{fBegindate},</if>
  175. <if test="fEnddate != null">f_enddate = #{fEnddate},</if>
  176. <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
  177. <if test="fStatus != null">f_status = #{fStatus},</if>
  178. <if test="delFlag != null">del_flag = #{delFlag},</if>
  179. <if test="createBy != null">create_by = #{createBy},</if>
  180. <if test="createTime != null">create_time = #{createTime},</if>
  181. <if test="updateBy != null">update_by = #{updateBy},</if>
  182. <if test="updateTime != null">update_time = #{updateTime},</if>
  183. <if test="remark != null">remark = #{remark},</if>
  184. <if test="fTaskType != null">f_task_type = #{fTaskType},</if>
  185. <if test="fDc != null">f_dc = #{fDc},</if>
  186. <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
  187. <if test="fBilltypeName != null">f_billtype_name = #{fBilltypeName},</if>
  188. </trim>
  189. where f_id = #{fId}
  190. </update>
  191. <delete id="deleteTWarehouseAgreementById" parameterType="Long">
  192. delete from t_warehouse_agreement where f_id = #{fId}
  193. </delete>
  194. <delete id="deleteTWarehouseAgreementByIds" parameterType="String">
  195. delete
  196. w.*,
  197. wa.*
  198. from
  199. t_warehouse_agreement w
  200. LEFT JOIN t_warehouse_agreementitems wa ON wa.f_pid = w.f_id
  201. where w.f_id in
  202. <foreach item="fId" collection="array" open="(" separator="," close=")">
  203. #{fId}
  204. </foreach>
  205. </delete>
  206. </mapper>