123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.system.mapper.PoCollectionMapper">
- <resultMap type="PoCollection" id="PoCollectionResult">
- <result property="collectionId" column="collection_id"/>
- <result property="collectionTitle" column="collection_title"/>
- <result property="collectionType" column="collection_type"/>
- <result property="status" column="status"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="delFlag" column="del_flag"/>
- <result property="remark" column="remark"/>
- <result property="image" column="image"/>
- <result property="formwork" column="formwork"/>
- <result property="price" column="price"/>
- <result property="publisherName" column="publisher_name"/>
- <result property="story" column="story"/>
- <result property="grounding" column="grouding"/>
- <result property="cochain" column="cochain"/>
- <result property="tetherId" column="tether_id"/>
- </resultMap>
- <sql id="selectPoCollectionVo">
- select collection_id,
- collection_title,
- collection_type,
- status,
- create_by,
- create_time,
- update_by,
- update_time,
- remark,
- del_flag,
- image,
- publisher_name,
- formwork,
- price,
- story,
- grounding,
- cochain,
- tether_id
- from po_collection
- </sql>
- <select id="selectCollectionById" parameterType="Long" resultMap="PoCollectionResult">
- <include refid="selectPoCollectionVo"/>
- where collection_id = #{collectionId}
- </select>
- <select id="selectPoCollectionList" parameterType="PoCollection" resultMap="PoCollectionResult">
- <include refid="selectPoCollectionVo"/>
- <where>
- <if test="collectionTitle != null and collectionTitle != ''">and collection_title = #{collectionTitle}</if>
- <if test="status != null and status != ''">and status = #{status}</if>
- <if test="collectionType != null ">and collection_type = #{collectionType}</if>
- <if test="total != null ">and total = #{total}</if>
- <if test="formwork != null and formwork != ''">and formwork = #{formwork}</if>
- <if test="price != null ">and price = #{price}</if>
- <if test="publisherName != null ">and publisher_name like concat('%', #{publisherName}, '%')</if>
- <if test="grounding != null ">and grounding = #{grounding}</if>
- <if test="cochain != null ">and cochain = #{cochain}</if>
- <if test="tetherId != null ">and tether_id = #{tetherId}</if>
- <if test="delFlag != null">and del_flag = #{delFlag}</if>
- <if test="delFlag == null">and del_flag = 0</if>
- </where>
- </select>
- <insert id="insertPoCollection" parameterType="PoCollection">
- insert into po_collection (
- <if test="collectionTitle != null and collectionTitle != '' ">collection_title,</if>
- <if test="collectionType != null and collectionType != '' ">collection_type,</if>
- <if test="status != null and status != '' ">status,</if>
- <if test="remark != null and remark != ''">remark,</if>
- <if test="createBy != null and createBy != ''">create_by,</if>
- <if test="total != null and total != ''">total,</if>
- <if test="image != null and image != ''">image,</if>
- <if test="publisherName != null and publisherName != ''">publisher_name,</if>
- <if test="formwork != null and formwork != ''">formwork,</if>
- <if test="price != null and price != ''">price,</if>
- <if test="story != null and story != ''">story,</if>
- <if test="grouding != null and grouding != ''">grounding,</if>
- <if test="cochain != null and cochain != ''">cochain,</if>
- <if test="tetherId != null and tetherId != ''">tether_id,</if>
- del_flag,
- create_time
- )values(
- <if test="collectionTitle != null and collectionTitle != ''">#{collectionTitle},</if>
- <if test="collectionType != null and collectionType != ''">#{collectionType},</if>
- <if test="status != null and status != ''">#{status},</if>
- <if test="remark != null and remark != ''">#{remark},</if>
- <if test="createBy != null and createBy != ''">#{createBy},</if>
- <if test="total != null and total != ''">#{total},</if>
- <if test="image != null and image != ''">#{image},</if>
- <if test="publisherName != null and publisherName != ''">#{publisherName},</if>
- <if test="formwork != null and formwork != ''">#{formwork},</if>
- <if test="price != null and price != ''">#{price},</if>
- <if test="story != null and story != ''">#{story},</if>
- <if test="grouding != null and grouding != ''">#{grounding},</if>
- <if test="cochain != null and cochain != ''">#{cochain},</if>
- <if test="tetherId != null and tetherId != ''">#{tetherId},</if>
- 0,
- sysdate()
- )
- </insert>
- <insert id="batchInsertPoCollection" parameterType="PoCollection">
- insert into po_collection (
- <if test="collectionTitle != null and collectionTitle != '' ">collection_title,</if>
- <if test="collectionType != null and collectionType != '' ">collection_type,</if>
- <if test="status != null and status != '' ">status,</if>
- <if test="remark != null and remark != ''">remark,</if>
- <if test="createBy != null and createBy != ''">create_by,</if>
- <if test="total != null and total != ''">total,</if>
- <if test="image != null and image != ''">image,</if>
- <if test="publisherName != null and publisherName != ''">publisher_name,</if>
- <if test="formwork != null and formwork != ''">formwork,</if>
- <if test="price != null and price != ''">price,</if>
- <if test="story != null and story != ''">story,</if>
- <if test="grouding != null and grouding != ''">grounding,</if>
- <if test="cochain != null and cochain != ''">cochain,</if>
- <if test="tetherId != null and tetherId != ''">tether_id,</if>
- del_flag,
- create_time
- )values(
- <foreach collection="collections" item="PoCollection" separator=",">
- <if test="collectionTitle != null and collectionTitle != ''">#{collectionTitle},</if>
- <if test="collectionType != null and collectionType != ''">#{collectionType},</if>
- <if test="status != null and status != ''">#{status},</if>
- <if test="remark != null and remark != ''">#{remark},</if>
- <if test="createBy != null and createBy != ''">#{createBy},</if>
- <if test="total != null and total != ''">#{total},</if>
- <if test="image != null and image != ''">#{image},</if>
- <if test="publisherName != null and publisherName != ''">#{publisherName},</if>
- <if test="formwork != null and formwork != ''">#{formwork},</if>
- <if test="price != null and price != ''">#{price},</if>
- <if test="story != null and story != ''">#{story},</if>
- <if test="grouding != null and grouding != ''">#{grounding},</if>
- <if test="cochain != null and cochain != ''">#{cochain},</if>
- <if test="tetherId != null and tetherId != ''">#{tetherId},</if>
- 0,
- sysdate()
- </foreach>
- )
- </insert>
- <update id="updatePoCollection" parameterType="PoCollection">
- update po_collection
- <set>
- <if test="collectionTitle != null and collectionTitle != ''">collection_title = #{collectionTitle},</if>
- <if test="collectionType != null and collectionType != ''">collection_type = #{collectionType},</if>
- <if test="status != null and status != ''">status = #{status},</if>
- <if test="remark != null and remark != ''">remark = #{remark},</if>
- <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
- <if test="total != null and total != ''">total = #{total},</if>
- <if test="image != null and image != ''">image = #{image},</if>
- <if test="publisherName != null and publisherName != ''">publisher_name = #{publisherName},</if>
- <if test="formwork != null and formwork != ''">formwork = #{formwork},</if>
- <if test="price != null and price != ''">price = #{price},</if>
- <if test="story != null and story != ''">story = #{story},</if>
- <if test="grouding != null and grouding != ''">grouding = #{grounding},</if>
- <if test="cochain != null and cochain != ''">cochain = #{cochain},</if>
- <if test="tetherId != null and tetherId != ''">tether_id = #{tetherId},</if>
- <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
- update_time = sysdate()
- </set>
- where collection_id = #{collectionId}
- </update>
- <update id="deletePoCollectionByCollectionId" parameterType="Long">
- update po_collection
- SET del_flag = 1
- where collection_id = #{collectionId}
- </update>
- <update id="deletePoCollectionByCollectionIds" parameterType="String">
- update po_collection SET del_flag = #{1} where collection_id in
- <foreach item="collectionId" collection="array" open="(" separator="," close=")">
- #{collectionId}
- </foreach>
- </update>
- </mapper>
|