PoCollectionMapper.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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="tetherId"/>
  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. publisher_name,
  38. formwork,
  39. price,
  40. story,
  41. grounding,
  42. cochain,
  43. tether_id
  44. from po_collection
  45. </sql>
  46. <select id="selectCollectionById" parameterType="Long" resultMap="PoCollectionResult">
  47. <include refid="selectPoCollectionVo"/>
  48. where collection_id = #{collectionId}
  49. </select>
  50. <select id="selectPoCollectionList" parameterType="PoCollection" resultMap="PoCollectionResult">
  51. <include refid="selectPoCollectionVo"/>
  52. <where>
  53. <if test="collectionTitle != null and collectionTitle != ''"> and collection_title = #{collectionTitle}</if>
  54. <if test="status != null and status != ''"> and status = #{status}</if>
  55. <if test="collectionType != null "> and collection_type = #{collectionType}</if>
  56. <if test="total != null "> and total = #{total}</if>
  57. <if test="image != null and image != ''"> and image = #{image}</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="story != null and story != ''"> and story = #{story}</if>
  62. <if test="grounding != null "> and grounding = #{grounding}</if>
  63. <if test="cochain != null "> and cochain = #{cochain}</if>
  64. <if test="tetherId != null "> and tether_id = #{tetherId}</if>
  65. </where>
  66. </select>
  67. <insert id="insertPoCollection" parameterType="PoCollection">
  68. insert into po_collection (
  69. <if test="collectionTitle != null and collectionTitle != '' ">collection_title,</if>
  70. <if test="collectionType != null and collectionType != '' ">collection_type,</if>
  71. <if test="status != null and status != '' ">status,</if>
  72. <if test="remark != null and remark != ''">remark,</if>
  73. <if test="createBy != null and createBy != ''">create_by,</if>
  74. <if test="publisherName != null and publisherName != ''">publisher_name,</if>
  75. <if test="formwork != null and formwork != ''">formwork,</if>
  76. <if test="price != null and price != ''">price,</if>
  77. <if test="story != null and story != ''">story,</if>
  78. <if test="grouding != null and grouding != ''">grounding,</if>
  79. <if test="cochain != null and cochain != ''">cochain,</if>
  80. <if test="tetherId != null and tetherId != ''">tether_id,</if>
  81. del_flag,
  82. create_time
  83. )values(
  84. <if test="collectionTitle != null and collectionTitle != ''">#{collectionTitle},</if>
  85. <if test="collectionType != null and collectionType != ''">#{collectionType},</if>
  86. <if test="status != null and status != ''">#{status},</if>
  87. <if test="remark != null and remark != ''">#{remark},</if>
  88. <if test="createBy != null and createBy != ''">#{createBy},</if>
  89. <if test="publisherName != null and publisherName != ''">#{publisherName},</if>
  90. <if test="formwork != null and formwork != ''">#{formwork},</if>
  91. <if test="price != null and price != ''">#{price},</if>
  92. <if test="story != null and story != ''">#{story},</if>
  93. <if test="grouding != null and grouding != ''">#{grounding},</if>
  94. <if test="cochain != null and cochain != ''">#{cochain},</if>
  95. <if test="tetherId != null and tetherId != ''">#{tetherId},</if>
  96. 0,
  97. sysdate()
  98. )
  99. </insert>
  100. <insert id="batchInsertPoCollection" parameterType="PoCollection">
  101. insert into po_collection (
  102. <if test="collectionTitle != null and collectionTitle != '' ">collection_title,</if>
  103. <if test="collectionType != null and collectionType != '' ">collection_type,</if>
  104. <if test="status != null and status != '' ">status,</if>
  105. <if test="remark != null and remark != ''">remark,</if>
  106. <if test="createBy != null and createBy != ''">create_by,</if>
  107. <if test="publisherName != null and publisherName != ''">publisher_name,</if>
  108. <if test="formwork != null and formwork != ''">formwork,</if>
  109. <if test="price != null and price != ''">price,</if>
  110. <if test="story != null and story != ''">story,</if>
  111. <if test="grouding != null and grouding != ''">grounding,</if>
  112. <if test="cochain != null and cochain != ''">cochain,</if>
  113. <if test="tetherId != null and tetherId != ''">tether_id,</if>
  114. del_flag,
  115. create_time
  116. )values(
  117. <foreach collection="collections" item="PoCollection" separator=",">
  118. <if test="collectionTitle != null and collectionTitle != ''">#{collectionTitle},</if>
  119. <if test="collectionType != null and collectionType != ''">#{collectionType},</if>
  120. <if test="status != null and status != ''">#{status},</if>
  121. <if test="remark != null and remark != ''">#{remark},</if>
  122. <if test="createBy != null and createBy != ''">#{createBy},</if>
  123. <if test="publisherName != null and publisherName != ''">#{publisherName},</if>
  124. <if test="formwork != null and formwork != ''">#{formwork},</if>
  125. <if test="price != null and price != ''">#{price},</if>
  126. <if test="story != null and story != ''">#{story},</if>
  127. <if test="grouding != null and grouding != ''">#{grounding},</if>
  128. <if test="cochain != null and cochain != ''">#{cochain},</if>
  129. <if test="tetherId != null and tetherId != ''">#{tetherId},</if>
  130. 0,
  131. sysdate()
  132. </foreach>
  133. )
  134. </insert>
  135. <update id="updatePoCollection" parameterType="PoCollection">
  136. update po_collection
  137. <set>
  138. <if test="collectionTitle != null and collectionTitle != ''">collection_title = #{collectionTitle},</if>
  139. <if test="collectionType != null and collectionType != ''">collection_type = #{collectionType},</if>
  140. <if test="status != null and status != ''">status = #{status},</if>
  141. <if test="remark != null and remark != ''">remark = #{remark},</if>
  142. <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
  143. <if test="publisherName != null and publisherName != ''">publisher_name = #{publisherName},</if>
  144. <if test="formwork != null and formwork != ''">formwork = #{formwork},</if>
  145. <if test="price != null and price != ''">price = #{price},</if>
  146. <if test="story != null and story != ''">story = #{story},</if>
  147. <if test="grouding != null and grouding != ''">grouding = #{grounding},</if>
  148. <if test="cochain != null and cochain != ''">cochain = #{cochain},</if>
  149. <if test="tetherId != null and tetherId != ''">tetherId = #{tetherId},</if>
  150. update_time = sysdate()
  151. </set>
  152. where collection_id = #{collectionId}
  153. </update>
  154. <delete id="deletePoCollectionByCollectionId" parameterType="Long">
  155. delete from po_collection where collection_id = #{collectionId}
  156. </delete>
  157. <delete id="deletePoCollectionByCollectionIds" parameterType="String">
  158. delete from po_collection where collection_id in
  159. <foreach item="collectionId" collection="array" open="(" separator="," close=")">
  160. #{collectionId}
  161. </foreach>
  162. </delete>
  163. </mapper>