meisiyu | c98fc52 | 2025-06-02 20:33:40 +0800 | [diff] [blame] | 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.web.controller.post.mapper.PostPromotionPlanMapper"> |
| 6 | |
| 7 | <resultMap type="com.ruoyi.web.controller.post.domain.PostPromotionPlan" id="PostPromotionPlanResult"> |
| 8 | <id property="planId" column="plan_id" /> |
| 9 | <result property="planName" column="plan_name" /> |
| 10 | <result property="planDescription" column="plan_description" /> |
| 11 | <result property="price" column="price" /> |
| 12 | <result property="duration" column="duration" /> |
| 13 | <result property="level" column="level" /> |
| 14 | <result property="status" column="status" /> |
| 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="remark" column="remark" /> |
| 20 | </resultMap> |
| 21 | |
| 22 | <sql id="selectPostPromotionPlanVo"> |
| 23 | select plan_id, plan_name, plan_description, price, duration, level, status, |
| 24 | create_by, create_time, update_by, update_time, remark |
| 25 | from post_promotion_plan |
| 26 | </sql> |
| 27 | |
| 28 | <select id="selectPostPromotionPlanList" parameterType="com.ruoyi.web.controller.post.domain.PostPromotionPlan" resultMap="PostPromotionPlanResult"> |
| 29 | <include refid="selectPostPromotionPlanVo"/> |
| 30 | <where> |
| 31 | <if test="planName != null and planName != ''"> |
| 32 | AND plan_name like concat('%', #{planName}, '%') |
| 33 | </if> |
| 34 | <if test="status != null and status != ''"> |
| 35 | AND status = #{status} |
| 36 | </if> |
| 37 | </where> |
| 38 | order by level asc, create_time desc |
| 39 | </select> |
| 40 | |
| 41 | <select id="selectPostPromotionPlanById" parameterType="Long" resultMap="PostPromotionPlanResult"> |
| 42 | <include refid="selectPostPromotionPlanVo"/> |
| 43 | where plan_id = #{planId} |
| 44 | </select> |
| 45 | |
| 46 | <insert id="insertPostPromotionPlan" parameterType="com.ruoyi.web.controller.post.domain.PostPromotionPlan" useGeneratedKeys="true" keyProperty="planId"> |
| 47 | insert into post_promotion_plan ( |
| 48 | plan_name, |
| 49 | plan_description, |
| 50 | price, |
| 51 | duration, |
| 52 | level, |
| 53 | status, |
| 54 | create_by, |
| 55 | create_time, |
| 56 | remark |
| 57 | ) values ( |
| 58 | #{planName}, |
| 59 | #{planDescription}, |
| 60 | #{price}, |
| 61 | #{duration}, |
| 62 | #{level}, |
| 63 | #{status}, |
| 64 | #{createBy}, |
| 65 | sysdate(), |
| 66 | #{remark} |
| 67 | ) |
| 68 | </insert> |
| 69 | |
| 70 | <update id="updatePostPromotionPlan" parameterType="com.ruoyi.web.controller.post.domain.PostPromotionPlan"> |
| 71 | update post_promotion_plan |
| 72 | <set> |
| 73 | <if test="planName != null and planName != ''">plan_name = #{planName},</if> |
| 74 | <if test="planDescription != null">plan_description = #{planDescription},</if> |
| 75 | <if test="price != null">price = #{price},</if> |
| 76 | <if test="duration != null">duration = #{duration},</if> |
| 77 | <if test="level != null">level = #{level},</if> |
| 78 | <if test="status != null and status != ''">status = #{status},</if> |
| 79 | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| 80 | <if test="remark != null">remark = #{remark},</if> |
| 81 | update_time = sysdate() |
| 82 | </set> |
| 83 | where plan_id = #{planId} |
| 84 | </update> |
| 85 | |
| 86 | <delete id="deletePostPromotionPlanById" parameterType="Long"> |
| 87 | delete from post_promotion_plan where plan_id = #{planId} |
| 88 | </delete> |
| 89 | |
| 90 | <delete id="deletePostPromotionPlanByIds" parameterType="Long"> |
| 91 | delete from post_promotion_plan where plan_id in |
| 92 | <foreach collection="array" item="planId" open="(" separator="," close=")"> |
| 93 | #{planId} |
| 94 | </foreach> |
| 95 | </delete> |
| 96 | |
| 97 | </mapper> |