TWarehouseAgreementMapper.xml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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="delFlag" column="del_flag"/>
  22. <result property="createBy" column="create_by"/>
  23. <result property="createTime" column="create_time"/>
  24. <result property="updateBy" column="update_by"/>
  25. <result property="updateTime" column="update_time"/>
  26. <result property="remark" column="remark"/>
  27. </resultMap>
  28. <sql id="selectTWarehouseAgreementVo">
  29. select f_id, f_billno,f_contractno, f_deptid, f_corpid, f_stltypeid, f_feetypeid, t_packages, f_trademodeid, f_freedays, f_begindate, f_enddate, f_billstatus, del_flag, create_by, create_time, update_by, update_time, remark from t_warehouse_agreement
  30. </sql>
  31. <select id="selectTWarehouseAgreementList" parameterType="TWarehouseAgreement"
  32. resultMap="TWarehouseAgreementResult">
  33. <include refid="selectTWarehouseAgreementVo"/>
  34. <where>
  35. <if test="fBillno != null and fBillno != ''">and f_billno = #{fBillno}</if>
  36. <if test="fContractno != null and fContractno != ''">and f_contractno = #{fContractno}</if>
  37. <if test="fDeptid != null ">and f_deptid = #{fDeptid}</if>
  38. <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
  39. <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
  40. <if test="fStltypeid != null ">and f_stltypeid = #{fStltypeid}</if>
  41. <if test="fFeetypeid != null ">and f_feetypeid = #{fFeetypeid}</if>
  42. <if test="tPackages != null and tPackages != ''">and t_packages = #{tPackages}</if>
  43. <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
  44. <if test="fFreedays != null ">and f_freedays = #{fFreedays}</if>
  45. <if test="fBegindate != null ">and f_begindate = #{fBegindate}</if>
  46. <if test="fEnddate != null ">and f_enddate = #{fEnddate}</if>
  47. <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
  48. </where>
  49. </select>
  50. <select id="selectTWarehouseAgreementList1" parameterType="TWarehouseAgreement"
  51. resultType="Map" >
  52. SELECT DISTINCT
  53. agre.f_id AS fId,
  54. corp.f_name AS fCorpid,
  55. agre.f_contractno AS fContractno,
  56. goods.f_name AS fGoodsid,
  57. agre.f_begindate AS fBegindate,
  58. agre.f_enddate AS fEnddate,
  59. agre.f_feetypeid AS fFeetypeid,
  60. agre.f_billstatus AS fBillstatus
  61. FROM
  62. t_warehouse_agreement agre
  63. LEFT JOIN t_corps corp ON corp.f_id = agre.f_corpid
  64. LEFT JOIN t_goods goods ON goods.f_id = agre.f_goodsid
  65. <where>
  66. <if test="fBillno != null and fBillno != ''">and agre.f_billno = #{fBillno}</if>
  67. <if test="fContractno != null and fContractno != ''">and agre.f_contractno = #{fContractno}</if>
  68. <if test="fDeptid != null ">and agre.f_deptid = #{fDeptid}</if>
  69. <if test="fCorpid != null ">and agre.f_corpid = #{fCorpid}</if>
  70. <if test="fGoodsid != null">and agre.f_goodsid = #{fGoodsid}</if>
  71. <if test="fStltypeid != null ">and agre.f_stltypeid = #{fStltypeid}</if>
  72. <if test="fFeetypeid != null ">and agre.f_feetypeid = #{fFeetypeid}</if>
  73. <if test="tPackages != null and tPackages != ''">and agre.t_packages = #{tPackages}</if>
  74. <if test="fTrademodeid != null ">and agre.f_trademodeid = #{fTrademodeid}</if>
  75. <if test="fFreedays != null ">and agre.f_freedays = #{fFreedays}</if>
  76. <if test="fBegindate != null ">and agre.f_begindate = #{fBegindate}</if>
  77. <if test="fEnddate != null ">and agre.f_enddate = #{fEnddate}</if>
  78. <if test="fBillstatus != null and fBillstatus != ''">and agre.f_billstatus = #{fBillstatus}</if>
  79. </where>
  80. </select>
  81. <select id="selectTWarehouseAgreementById" parameterType="Long" resultMap="TWarehouseAgreementResult">
  82. <include refid="selectTWarehouseAgreementVo"/>
  83. where f_id = #{fId}
  84. </select>
  85. <insert id="insertTWarehouseAgreement" parameterType="TWarehouseAgreement" useGeneratedKeys="true"
  86. keyProperty="fId">
  87. insert into t_warehouse_agreement
  88. <trim prefix="(" suffix=")" suffixOverrides=",">
  89. <if test="fBillno != null and fBillno != ''">f_billno,</if>
  90. <if test="fContractno != null and fContractno != ''">f_contractno,</if>
  91. <if test="fDeptid != null">f_deptid,</if>
  92. <if test="fCorpid != null">f_corpid,</if>
  93. <if test="fGoodsid != null">f_goodsid,</if>
  94. <if test="fStltypeid != null">f_stltypeid,</if>
  95. <if test="fFeetypeid != null">f_feetypeid,</if>
  96. <if test="tPackages != null">t_packages,</if>
  97. <if test="fTrademodeid != null">f_trademodeid,</if>
  98. <if test="fFreedays != null">f_freedays,</if>
  99. <if test="fBegindate != null">f_begindate,</if>
  100. <if test="fEnddate != null">f_enddate,</if>
  101. <if test="fBillstatus != null">f_billstatus,</if>
  102. <if test="delFlag != null">del_flag,</if>
  103. <if test="createBy != null">create_by,</if>
  104. <if test="createTime != null">create_time,</if>
  105. <if test="updateBy != null">update_by,</if>
  106. <if test="updateTime != null">update_time,</if>
  107. <if test="remark != null">remark,</if>
  108. </trim>
  109. <trim prefix="values (" suffix=")" suffixOverrides=",">
  110. <if test="fBillno != null and fBillno != ''">#{fBillno},</if>
  111. <if test="fContractno != null and fContractno != ''">#{fContractno},</if>
  112. <if test="fDeptid != null">#{fDeptid},</if>
  113. <if test="fCorpid != null">#{fCorpid},</if>
  114. <if test="fGoodsid != null">#{fGoodsid},</if>
  115. <if test="fStltypeid != null">#{fStltypeid},</if>
  116. <if test="fFeetypeid != null">#{fFeetypeid},</if>
  117. <if test="tPackages != null">#{tPackages},</if>
  118. <if test="fTrademodeid != null">#{fTrademodeid},</if>
  119. <if test="fFreedays != null">#{fFreedays},</if>
  120. <if test="fBegindate != null">#{fBegindate},</if>
  121. <if test="fEnddate != null">#{fEnddate},</if>
  122. <if test="fBillstatus != null">#{fBillstatus},</if>
  123. <if test="delFlag != null">#{delFlag},</if>
  124. <if test="createBy != null">#{createBy},</if>
  125. <if test="createTime != null">#{createTime},</if>
  126. <if test="updateBy != null">#{updateBy},</if>
  127. <if test="updateTime != null">#{updateTime},</if>
  128. <if test="remark != null">#{remark},</if>
  129. </trim>
  130. </insert>
  131. <update id="updateTWarehouseAgreement" parameterType="TWarehouseAgreement">
  132. update t_warehouse_agreement
  133. <trim prefix="SET" suffixOverrides=",">
  134. <if test="fBillno != null and fBillno != ''">f_billno = #{fBillno},</if>
  135. <if test="fContractno != null and fContractno != ''">f_billno = #{fContractno},</if>
  136. <if test="fDeptid != null">f_deptid = #{fDeptid},</if>
  137. <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
  138. <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
  139. <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
  140. <if test="fFeetypeid != null">f_feetypeid = #{fFeetypeid},</if>
  141. <if test="tPackages != null">t_packages = #{tPackages},</if>
  142. <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
  143. <if test="fFreedays != null">f_freedays = #{fFreedays},</if>
  144. <if test="fBegindate != null">f_begindate = #{fBegindate},</if>
  145. <if test="fEnddate != null">f_enddate = #{fEnddate},</if>
  146. <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
  147. <if test="delFlag != null">del_flag = #{delFlag},</if>
  148. <if test="createBy != null">create_by = #{createBy},</if>
  149. <if test="createTime != null">create_time = #{createTime},</if>
  150. <if test="updateBy != null">update_by = #{updateBy},</if>
  151. <if test="updateTime != null">update_time = #{updateTime},</if>
  152. <if test="remark != null">remark = #{remark},</if>
  153. </trim>
  154. where f_id = #{fId}
  155. </update>
  156. <delete id="deleteTWarehouseAgreementById" parameterType="Long">
  157. delete from t_warehouse_agreement where f_id = #{fId}
  158. </delete>
  159. <delete id="deleteTWarehouseAgreementByIds" parameterType="String">
  160. delete from t_warehouse_agreement where f_id in
  161. <foreach item="fId" collection="array" open="(" separator="," close=")">
  162. #{fId}
  163. </foreach>
  164. </delete>
  165. </mapper>