|
@@ -0,0 +1,180 @@
|
|
|
+<?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.PoTetherMapper">
|
|
|
+
|
|
|
+ <resultMap type="PoTether" id="PoTetherResult">
|
|
|
+ <result property="tetherId" column="tether_id" />
|
|
|
+ <result property="tetherName" column="tether_name" />
|
|
|
+ <result property="showTime" column="show_time" />
|
|
|
+ <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="total" column="total" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="sellStatus" column="sell_status"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="PoCollection" id="PoCollectionResult">
|
|
|
+ <result property="collectionId" column="collection_id" />
|
|
|
+ <result property="collectionTitle" column="collection_title" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="collectionType" column="collection_type" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="total" column="total" />
|
|
|
+ <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="grounding" />
|
|
|
+ <result property="cochain" column="cochain" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectPoTetherVo">
|
|
|
+ select tether_id, tether_name, show_time, create_by, create_time, update_by, update_time, total, status, remark ,sell_status,del_flag from po_tether
|
|
|
+ </sql>
|
|
|
+
|
|
|
+<!--在售-->
|
|
|
+ <select id="selectPoTetherSellingList" parameterType="PoTether" resultMap="PoTetherResult">
|
|
|
+ <include refid="selectPoTetherVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="tetherName != null and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
|
|
|
+ <if test="showTime != null "> and show_time = #{showTime}</if>
|
|
|
+ <if test="total != null "> and total = #{total}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ and del_flag = '0'
|
|
|
+ and sell_status = 0
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!--获取详细信息-->
|
|
|
+ <select id="selectPoTetherByTetherId" parameterType="Long" resultMap="PoTetherResult">
|
|
|
+ <include refid="selectPoTetherVo"/>
|
|
|
+ where tether_id = #{tetherId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 标题时间都不为空-->
|
|
|
+ <select id="selectPoTetherListByTitleAndTetherTimeStartAndTetherTimeEnd"
|
|
|
+ resultType="PoTether" resultMap="PoTetherResult">
|
|
|
+ <include refid="selectPoTetherVo"></include>
|
|
|
+ <where>
|
|
|
+ <if test="tetherName != null and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
|
|
|
+ <if test="tetherTimeStart != null and tetherTimeEnd != null "> and show_time between #{tetherTimeStart} and #{tetherTimeEnd}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!--预售-->
|
|
|
+ <select id="selectPoTetherAdvanceList" resultType="PoTether" resultMap="PoTetherResult">
|
|
|
+ <include refid="selectPoTetherVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="tetherName != null and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
|
|
|
+ <if test="showTime != null "> and show_time = #{showTime}</if>
|
|
|
+ <if test="total != null "> and total = #{total}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ and del_flag = '0'
|
|
|
+ and sell_status = 1
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!--已过期-->
|
|
|
+ <select id="selectPoTetherSelledList" resultType="PoTether" resultMap="PoTetherResult">
|
|
|
+ <include refid="selectPoTetherVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="tetherName != null and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
|
|
|
+ <if test="showTime != null "> and show_time = #{showTime}</if>
|
|
|
+ <if test="total != null "> and total = #{total}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ and del_flag = '0'
|
|
|
+ and sell_status = 2
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!--全为空时-->
|
|
|
+ <select id="selectPoTetherList" resultType="PoTether" resultMap="PoTetherResult">
|
|
|
+ <include refid="selectPoTetherVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="tetherName != null and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
|
|
|
+ <if test="showTime != null "> and show_time = #{showTime}</if>
|
|
|
+ <if test="total != null "> and total = #{total}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ and del_flag = '0'
|
|
|
+ </where>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 根据套系id 查询对应藏品按钮里面的藏品信息-->
|
|
|
+ <select id="selectPoCollectionListById" resultMap="PoCollectionResult" >
|
|
|
+ select c.collection_title , c.image , c.collection_type , c.create_time , c.create_by
|
|
|
+ , c.total , c.status , c.price , c.story , c.grounding , c.cochain from po_collection c
|
|
|
+ left join po_tether t on t.tether_id = c.tether_id where t.tether_id = #{tetherId}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!--新增-->
|
|
|
+ <insert id="insertPoTether" parameterType="PoTether" useGeneratedKeys="true" keyProperty="tetherId">
|
|
|
+ insert into po_tether
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="tetherName != null">tether_name,</if>
|
|
|
+ <if test="showTime != null">show_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="total != null">total,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="sellStatus != null">sell_status,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="tetherName != null">#{tetherName},</if>
|
|
|
+ <if test="showTime != null">#{showTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="total != null">#{total},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="sellStatus != null">#{sellStatus},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updatePoTether" parameterType="PoTether">
|
|
|
+ update po_tether
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="tetherName != null">tether_name = #{tetherName},</if>
|
|
|
+ <if test="showTime != null">show_time = #{showTime},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="total != null">total = #{total},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="sellStatus != null">sell_status = #{sellStatus},</if>
|
|
|
+ </trim>
|
|
|
+ where tether_id = #{tetherId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deletePoTetherByTetherId" parameterType="Long">
|
|
|
+ delete from po_tether where tether_id = #{tetherId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deletePoTetherByTetherIds" parameterType="String">
|
|
|
+ delete from po_tether where tether_id in
|
|
|
+ <foreach item="tetherId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{tetherId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|
|
|
+
|