PoCollectionMapper.xml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.system.mapper.PoCollectionMapper">
  6. <resultMap type="PoCollection" id="PoCollectionResult">
  7. <result property="collectionId" column="collection_id"/>
  8. <result property="collectionTitle" column="collection_title"/>
  9. <result property="collectionType" column="collection_type"/>
  10. <result property="status" column="status"/>
  11. <result property="createBy" column="create_by"/>
  12. <result property="createTime" column="create_time"/>
  13. <result property="updateBy" column="update_by"/>
  14. <result property="updateTime" column="update_time"/>
  15. <result property="delFlag" column="del_flag"/>
  16. <result property="remark" column="remark"/>
  17. <result property="image" column="image"/>
  18. <result property="formwork" column="formwork"/>
  19. <result property="price" column="price"/>
  20. <result property="publisherName" column="publisher_name"/>
  21. <result property="story" column="story"/>
  22. <result property="grounding" column="grouding"/>
  23. <result property="cochain" column="cochain"/>
  24. <result property="tetherId" column="tether_id"/>
  25. </resultMap>
  26. <sql id="selectPoCollectionVo">
  27. select collection_id,
  28. collection_title,
  29. collection_type,
  30. status,
  31. create_by,
  32. create_time,
  33. update_by,
  34. update_time,
  35. remark,
  36. del_flag,
  37. image,
  38. publisher_name,
  39. formwork,
  40. price,
  41. story,
  42. grounding,
  43. cochain,
  44. tether_id
  45. from po_collection
  46. </sql>
  47. <select id="selectCollectionById" parameterType="Long" resultMap="PoCollectionResult">
  48. <include refid="selectPoCollectionVo"/>
  49. where collection_id = #{collectionId}
  50. </select>
  51. <select id="selectPoCollectionList" parameterType="PoCollection" resultMap="PoCollectionResult">
  52. <include refid="selectPoCollectionVo"/>
  53. <where>
  54. <if test="collectionTitle != null and collectionTitle != ''">and collection_title = #{collectionTitle}</if>
  55. <if test="status != null and status != ''">and status = #{status}</if>
  56. <if test="collectionType != null ">and collection_type = #{collectionType}</if>
  57. <if test="total != null ">and total = #{total}</if>
  58. <if test="formwork != null and formwork != ''">and formwork = #{formwork}</if>
  59. <if test="price != null ">and price = #{price}</if>
  60. <if test="publisherName != null ">and publisher_name like concat('%', #{publisherName}, '%')</if>
  61. <if test="grounding != null ">and grounding = #{grounding}</if>
  62. <if test="cochain != null ">and cochain = #{cochain}</if>
  63. <if test="tetherId != null ">and tether_id = #{tetherId}</if>
  64. <if test="delFlag != null">and del_flag = #{delFlag}</if>
  65. <if test="delFlag == null">and del_flag = 0</if>
  66. </where>
  67. </select>
  68. <insert id="insertPoCollection" parameterType="PoCollection">
  69. insert into po_collection (
  70. <if test="collectionTitle != null and collectionTitle != '' ">collection_title,</if>
  71. <if test="collectionType != null and collectionType != '' ">collection_type,</if>
  72. <if test="status != null and status != '' ">status,</if>
  73. <if test="remark != null and remark != ''">remark,</if>
  74. <if test="createBy != null and createBy != ''">create_by,</if>
  75. <if test="total != null and total != ''">total,</if>
  76. <if test="image != null and image != ''">image,</if>
  77. <if test="publisherName != null and publisherName != ''">publisher_name,</if>
  78. <if test="formwork != null and formwork != ''">formwork,</if>
  79. <if test="price != null and price != ''">price,</if>
  80. <if test="story != null and story != ''">story,</if>
  81. <if test="grouding != null and grouding != ''">grounding,</if>
  82. <if test="cochain != null and cochain != ''">cochain,</if>
  83. <if test="tetherId != null and tetherId != ''">tether_id,</if>
  84. del_flag,
  85. create_time
  86. )values(
  87. <if test="collectionTitle != null and collectionTitle != ''">#{collectionTitle},</if>
  88. <if test="collectionType != null and collectionType != ''">#{collectionType},</if>
  89. <if test="status != null and status != ''">#{status},</if>
  90. <if test="remark != null and remark != ''">#{remark},</if>
  91. <if test="createBy != null and createBy != ''">#{createBy},</if>
  92. <if test="total != null and total != ''">#{total},</if>
  93. <if test="image != null and image != ''">#{image},</if>
  94. <if test="publisherName != null and publisherName != ''">#{publisherName},</if>
  95. <if test="formwork != null and formwork != ''">#{formwork},</if>
  96. <if test="price != null and price != ''">#{price},</if>
  97. <if test="story != null and story != ''">#{story},</if>
  98. <if test="grouding != null and grouding != ''">#{grounding},</if>
  99. <if test="cochain != null and cochain != ''">#{cochain},</if>
  100. <if test="tetherId != null and tetherId != ''">#{tetherId},</if>
  101. 0,
  102. sysdate()
  103. )
  104. </insert>
  105. <insert id="batchInsertPoCollection" parameterType="PoCollection">
  106. insert into po_collection (
  107. <if test="collectionTitle != null and collectionTitle != '' ">collection_title,</if>
  108. <if test="collectionType != null and collectionType != '' ">collection_type,</if>
  109. <if test="status != null and status != '' ">status,</if>
  110. <if test="remark != null and remark != ''">remark,</if>
  111. <if test="createBy != null and createBy != ''">create_by,</if>
  112. <if test="total != null and total != ''">total,</if>
  113. <if test="image != null and image != ''">image,</if>
  114. <if test="publisherName != null and publisherName != ''">publisher_name,</if>
  115. <if test="formwork != null and formwork != ''">formwork,</if>
  116. <if test="price != null and price != ''">price,</if>
  117. <if test="story != null and story != ''">story,</if>
  118. <if test="grouding != null and grouding != ''">grounding,</if>
  119. <if test="cochain != null and cochain != ''">cochain,</if>
  120. <if test="tetherId != null and tetherId != ''">tether_id,</if>
  121. del_flag,
  122. create_time
  123. )values(
  124. <foreach collection="collections" item="PoCollection" separator=",">
  125. <if test="collectionTitle != null and collectionTitle != ''">#{collectionTitle},</if>
  126. <if test="collectionType != null and collectionType != ''">#{collectionType},</if>
  127. <if test="status != null and status != ''">#{status},</if>
  128. <if test="remark != null and remark != ''">#{remark},</if>
  129. <if test="createBy != null and createBy != ''">#{createBy},</if>
  130. <if test="total != null and total != ''">#{total},</if>
  131. <if test="image != null and image != ''">#{image},</if>
  132. <if test="publisherName != null and publisherName != ''">#{publisherName},</if>
  133. <if test="formwork != null and formwork != ''">#{formwork},</if>
  134. <if test="price != null and price != ''">#{price},</if>
  135. <if test="story != null and story != ''">#{story},</if>
  136. <if test="grouding != null and grouding != ''">#{grounding},</if>
  137. <if test="cochain != null and cochain != ''">#{cochain},</if>
  138. <if test="tetherId != null and tetherId != ''">#{tetherId},</if>
  139. 0,
  140. sysdate()
  141. </foreach>
  142. )
  143. </insert>
  144. <update id="updatePoCollection" parameterType="PoCollection">
  145. update po_collection
  146. <set>
  147. <if test="collectionTitle != null and collectionTitle != ''">collection_title = #{collectionTitle},</if>
  148. <if test="collectionType != null and collectionType != ''">collection_type = #{collectionType},</if>
  149. <if test="status != null and status != ''">status = #{status},</if>
  150. <if test="remark != null and remark != ''">remark = #{remark},</if>
  151. <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
  152. <if test="total != null and total != ''">total = #{total},</if>
  153. <if test="image != null and image != ''">image = #{image},</if>
  154. <if test="publisherName != null and publisherName != ''">publisher_name = #{publisherName},</if>
  155. <if test="formwork != null and formwork != ''">formwork = #{formwork},</if>
  156. <if test="price != null and price != ''">price = #{price},</if>
  157. <if test="story != null and story != ''">story = #{story},</if>
  158. <if test="grouding != null and grouding != ''">grouding = #{grounding},</if>
  159. <if test="cochain != null and cochain != ''">cochain = #{cochain},</if>
  160. <if test="tetherId != null and tetherId != ''">tether_id = #{tetherId},</if>
  161. <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
  162. update_time = sysdate()
  163. </set>
  164. where collection_id = #{collectionId}
  165. </update>
  166. <update id="deletePoCollectionByCollectionId" parameterType="Long">
  167. update po_collection
  168. SET del_flag = 1
  169. where collection_id = #{collectionId}
  170. </update>
  171. <update id="deletePoCollectionByCollectionIds" parameterType="String">
  172. update po_collection SET del_flag = #{1} where collection_id in
  173. <foreach item="collectionId" collection="array" open="(" separator="," close=")">
  174. #{collectionId}
  175. </foreach>
  176. </update>
  177. </mapper>