| <?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.web.controller.post.mapper.PostPromotionPlanMapper"> |
| |
| <resultMap type="com.ruoyi.web.controller.post.domain.PostPromotionPlan" id="PostPromotionPlanResult"> |
| <id property="planId" column="plan_id" /> |
| <result property="planName" column="plan_name" /> |
| <result property="planDescription" column="plan_description" /> |
| <result property="price" column="price" /> |
| <result property="duration" column="duration" /> |
| <result property="level" column="level" /> |
| <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="remark" column="remark" /> |
| </resultMap> |
| |
| <sql id="selectPostPromotionPlanVo"> |
| select plan_id, plan_name, plan_description, price, duration, level, status, |
| create_by, create_time, update_by, update_time, remark |
| from post_promotion_plan |
| </sql> |
| |
| <select id="selectPostPromotionPlanList" parameterType="com.ruoyi.web.controller.post.domain.PostPromotionPlan" resultMap="PostPromotionPlanResult"> |
| <include refid="selectPostPromotionPlanVo"/> |
| <where> |
| <if test="planName != null and planName != ''"> |
| AND plan_name like concat('%', #{planName}, '%') |
| </if> |
| <if test="status != null and status != ''"> |
| AND status = #{status} |
| </if> |
| </where> |
| order by level asc, create_time desc |
| </select> |
| |
| <select id="selectPostPromotionPlanById" parameterType="Long" resultMap="PostPromotionPlanResult"> |
| <include refid="selectPostPromotionPlanVo"/> |
| where plan_id = #{planId} |
| </select> |
| |
| <insert id="insertPostPromotionPlan" parameterType="com.ruoyi.web.controller.post.domain.PostPromotionPlan" useGeneratedKeys="true" keyProperty="planId"> |
| insert into post_promotion_plan ( |
| plan_name, |
| plan_description, |
| price, |
| duration, |
| level, |
| status, |
| create_by, |
| create_time, |
| remark |
| ) values ( |
| #{planName}, |
| #{planDescription}, |
| #{price}, |
| #{duration}, |
| #{level}, |
| #{status}, |
| #{createBy}, |
| sysdate(), |
| #{remark} |
| ) |
| </insert> |
| |
| <update id="updatePostPromotionPlan" parameterType="com.ruoyi.web.controller.post.domain.PostPromotionPlan"> |
| update post_promotion_plan |
| <set> |
| <if test="planName != null and planName != ''">plan_name = #{planName},</if> |
| <if test="planDescription != null">plan_description = #{planDescription},</if> |
| <if test="price != null">price = #{price},</if> |
| <if test="duration != null">duration = #{duration},</if> |
| <if test="level != null">level = #{level},</if> |
| <if test="status != null and status != ''">status = #{status},</if> |
| <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| <if test="remark != null">remark = #{remark},</if> |
| update_time = sysdate() |
| </set> |
| where plan_id = #{planId} |
| </update> |
| |
| <delete id="deletePostPromotionPlanById" parameterType="Long"> |
| delete from post_promotion_plan where plan_id = #{planId} |
| </delete> |
| |
| <delete id="deletePostPromotionPlanByIds" parameterType="Long"> |
| delete from post_promotion_plan where plan_id in |
| <foreach collection="array" item="planId" open="(" separator="," close=")"> |
| #{planId} |
| </foreach> |
| </delete> |
| |
| </mapper> |