PoCollectionMapper.xml 9.0 KB

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