|
@@ -1,96 +1,111 @@
|
|
|
<?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.caimei.modules.supers.dao.CmSvipPackageDao">
|
|
|
-
|
|
|
- <sql id="cmSvipPackageColumns">
|
|
|
- a.id AS "id",
|
|
|
+
|
|
|
+ <sql id="cmSvipPackageColumns">
|
|
|
+ a.id AS "id",
|
|
|
a.name AS "name",
|
|
|
a.price AS "price",
|
|
|
a.duration AS "duration",
|
|
|
a.proportion AS "proportion"
|
|
|
- </sql>
|
|
|
-
|
|
|
- <sql id="cmSvipPackageJoins">
|
|
|
- </sql>
|
|
|
-
|
|
|
- <select id="get" resultType="CmSvipPackage">
|
|
|
- SELECT
|
|
|
- <include refid="cmSvipPackageColumns"/>
|
|
|
- FROM cm_svip_package a
|
|
|
- <include refid="cmSvipPackageJoins"/>
|
|
|
- WHERE a.id = #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findList" resultType="CmSvipPackage">
|
|
|
- SELECT
|
|
|
- <include refid="cmSvipPackageColumns"/>
|
|
|
- FROM cm_svip_package a
|
|
|
- <include refid="cmSvipPackageJoins"/>
|
|
|
- <where>
|
|
|
-
|
|
|
- <if test="name != null and name != ''">
|
|
|
- AND a.name LIKE
|
|
|
- <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
|
- <if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
|
|
|
- <if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- <choose>
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findAllList" resultType="CmSvipPackage">
|
|
|
- SELECT
|
|
|
- <include refid="cmSvipPackageColumns"/>
|
|
|
- FROM cm_svip_package a
|
|
|
- <include refid="cmSvipPackageJoins"/>
|
|
|
- <where>
|
|
|
-
|
|
|
- </where>
|
|
|
- <choose>
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="insert" parameterType="CmSvipPackage" keyProperty="id" useGeneratedKeys="true">
|
|
|
- INSERT INTO cm_svip_package(
|
|
|
- id,
|
|
|
- name,
|
|
|
- price,
|
|
|
- duration,
|
|
|
- delFlag,
|
|
|
- proportion
|
|
|
- ) VALUES (
|
|
|
- #{id},
|
|
|
- #{name},
|
|
|
- #{price},
|
|
|
- #{duration},
|
|
|
- 0,
|
|
|
- #{proportion}
|
|
|
- )
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="update">
|
|
|
- UPDATE cm_svip_package SET
|
|
|
- name = #{name},
|
|
|
- price = #{price},
|
|
|
- duration = #{duration},
|
|
|
- proportion = #{proportion}
|
|
|
- WHERE id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="delete">
|
|
|
- DELETE FROM cm_svip_package
|
|
|
- WHERE id = #{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="cmSvipPackageJoins">
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="get" resultType="CmSvipPackage">
|
|
|
+ SELECT
|
|
|
+ <include refid="cmSvipPackageColumns"/>
|
|
|
+ FROM cm_svip_package a
|
|
|
+ <include refid="cmSvipPackageJoins"/>
|
|
|
+ WHERE a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findList" resultType="CmSvipPackage">
|
|
|
+ SELECT
|
|
|
+ <include refid="cmSvipPackageColumns"/>
|
|
|
+ FROM cm_svip_package a
|
|
|
+ <include refid="cmSvipPackageJoins"/>
|
|
|
+ <where>
|
|
|
+
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND a.name LIKE
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
|
+ <if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findAllList" resultType="CmSvipPackage">
|
|
|
+ SELECT
|
|
|
+ <include refid="cmSvipPackageColumns"/>
|
|
|
+ FROM cm_svip_package a
|
|
|
+ <include refid="cmSvipPackageJoins"/>
|
|
|
+ <where>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findPackage" resultType="com.caimei.modules.supers.entity.CmSvipPackage">
|
|
|
+ select price, duration, proportion
|
|
|
+ from cm_svip_package
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="CmSvipPackage" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ INSERT INTO cm_svip_package(id,
|
|
|
+ name,
|
|
|
+ price,
|
|
|
+ duration,
|
|
|
+ delFlag,
|
|
|
+ proportion)
|
|
|
+ VALUES (#{id},
|
|
|
+ #{name},
|
|
|
+ #{price},
|
|
|
+ #{duration},
|
|
|
+ 0,
|
|
|
+ #{proportion})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="update">
|
|
|
+ UPDATE cm_svip_package
|
|
|
+ SET name = #{name},
|
|
|
+ price = #{price},
|
|
|
+ duration = #{duration},
|
|
|
+ proportion = #{proportion}
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updatePrice">
|
|
|
+ update cm_svip_package
|
|
|
+ set
|
|
|
+ <if test="price != null">
|
|
|
+ price = #{price},
|
|
|
+ </if>
|
|
|
+ <if test="proportion != null">
|
|
|
+ proportion = #{proportion}
|
|
|
+ </if>
|
|
|
+ where duration = #{duration}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE
|
|
|
+ FROM cm_svip_package
|
|
|
+ WHERE id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
</mapper>
|