|
@@ -0,0 +1,99 @@
|
|
|
|
|
+<?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.fs.his.mapper.FsCourseCouponMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="FsCourseCoupon" id="FsCourseCouponResult">
|
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
|
+ <result property="limitTime" column="limit_time" />
|
|
|
|
|
+ <result property="number" column="number" />
|
|
|
|
|
+ <result property="remainNumber" column="remain_number" />
|
|
|
|
|
+ <result property="status" column="status" />
|
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
|
+ <result property="limitDay" column="limit_day" />
|
|
|
|
|
+ <result property="limitType" column="limit_type" />
|
|
|
|
|
+ <result property="limitCount" column="limit_count" />
|
|
|
|
|
+ <result property="title" column="title" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectFsCourseCouponVo">
|
|
|
|
|
+ select id, create_time, limit_time, number, remain_number, status, update_time, limit_day, limit_type, limit_count, title from fs_course_coupon
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsCourseCouponList" parameterType="FsCourseCoupon" resultMap="FsCourseCouponResult">
|
|
|
|
|
+ <include refid="selectFsCourseCouponVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="limitTime != null "> and limit_time = #{limitTime}</if>
|
|
|
|
|
+ <if test="number != null "> and number = #{number}</if>
|
|
|
|
|
+ <if test="remainNumber != null "> and remain_number = #{remainNumber}</if>
|
|
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
|
|
+ <if test="limitDay != null "> and limit_day = #{limitDay}</if>
|
|
|
|
|
+ <if test="limitType != null "> and limit_type = #{limitType}</if>
|
|
|
|
|
+ <if test="limitCount != null "> and limit_count = #{limitCount}</if>
|
|
|
|
|
+ <if test="title != null and title != ''"> and title = #{title}</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsCourseCouponById" parameterType="Long" resultMap="FsCourseCouponResult">
|
|
|
|
|
+ <include refid="selectFsCourseCouponVo"/>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertFsCourseCoupon" parameterType="FsCourseCoupon" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into fs_course_coupon
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
|
+ <if test="limitTime != null">limit_time,</if>
|
|
|
|
|
+ <if test="number != null">number,</if>
|
|
|
|
|
+ <if test="remainNumber != null">remain_number,</if>
|
|
|
|
|
+ <if test="status != null">status,</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
|
+ <if test="limitDay != null">limit_day,</if>
|
|
|
|
|
+ <if test="limitType != null">limit_type,</if>
|
|
|
|
|
+ <if test="limitCount != null">limit_count,</if>
|
|
|
|
|
+ <if test="title != null">title,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
|
+ <if test="limitTime != null">#{limitTime},</if>
|
|
|
|
|
+ <if test="number != null">#{number},</if>
|
|
|
|
|
+ <if test="remainNumber != null">#{remainNumber},</if>
|
|
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
+ <if test="limitDay != null">#{limitDay},</if>
|
|
|
|
|
+ <if test="limitType != null">#{limitType},</if>
|
|
|
|
|
+ <if test="limitCount != null">#{limitCount},</if>
|
|
|
|
|
+ <if test="title != null">#{title},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateFsCourseCoupon" parameterType="FsCourseCoupon">
|
|
|
|
|
+ update fs_course_coupon
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
+ <if test="limitTime != null">limit_time = #{limitTime},</if>
|
|
|
|
|
+ <if test="number != null">number = #{number},</if>
|
|
|
|
|
+ <if test="remainNumber != null">remain_number = #{remainNumber},</if>
|
|
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
+ <if test="limitDay != null">limit_day = #{limitDay},</if>
|
|
|
|
|
+ <if test="limitType != null">limit_type = #{limitType},</if>
|
|
|
|
|
+ <if test="limitCount != null">limit_count = #{limitCount},</if>
|
|
|
|
|
+ <if test="title != null">title = #{title},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteFsCourseCouponById" parameterType="Long">
|
|
|
|
|
+ delete from fs_course_coupon where id = #{id}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteFsCourseCouponByIds" parameterType="String">
|
|
|
|
|
+ delete from fs_course_coupon where id in
|
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+</mapper>
|