123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <?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.cmpage.dao.CmPageBigTopicDao">
-
- <sql id="cmPageBigTopicColumns">
- a.id AS "id",
- a.title AS "title",
- a.description AS "description",
- a.suspensionName AS "suspensionName",
- a.sort AS "sort",
- a.enabledStatus AS "enabledStatus",
- a.crmEnabledStatus AS "crmEnabledStatus",
- a.createBy AS "createBy.id",
- a.createDate AS "createDate",
- a.updateBy AS "updateBy.id",
- a.updateDate AS "updateDate",
- a.delFlag AS "delFlag"
- </sql>
-
- <sql id="cmPageBigTopicJoins">
- </sql>
-
- <select id="get" resultType="CmPageBigTopic">
- SELECT
- <include refid="cmPageBigTopicColumns"/>
- FROM cm_page_big_topic a
- <include refid="cmPageBigTopicJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultType="CmPageBigTopic">
- SELECT
- <include refid="cmPageBigTopicColumns"/>
- FROM cm_page_big_topic a
- <include refid="cmPageBigTopicJoins"/>
- <where>
- a.delFlag = 0
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- ORDER BY a.sort DESC,a.enabledStatus DESC,a.createDate DESC,crmEnabledStatus DESC
- </otherwise>
- </choose>
- </select>
-
- <select id="findAllList" resultType="CmPageBigTopic">
- SELECT
- <include refid="cmPageBigTopicColumns"/>
- FROM cm_page_big_topic a
- <include refid="cmPageBigTopicJoins"/>
- <where>
- a.delFlag = 0
- </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="CmPageBigTopic" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO cm_page_big_topic(
- title,
- description,
- suspensionName,
- sort,
- enabledStatus,
- crmEnabledStatus,
- createBy,
- createDate,
- updateBy,
- updateDate,
- delFlag
- ) VALUES (
- #{title},
- #{description},
- #{suspensionName},
- #{sort},
- #{enabledStatus},
- #{crmEnabledStatus},
- #{createBy.id},
- #{createDate},
- #{updateBy.id},
- #{updateDate},
- #{delFlag}
- )
- </insert>
-
- <update id="update">
- UPDATE cm_page_big_topic SET
- title = #{title},
- description = #{description},
- suspensionName = #{suspensionName},
- sort = #{sort},
- enabledStatus = #{enabledStatus},
- crmEnabledStatus = #{crmEnabledStatus},
- createBy = #{createBy.id},
- createDate = #{createDate},
- updateBy = #{updateBy.id},
- updateDate = #{updateDate},
- delFlag = #{delFlag}
- WHERE id = #{id}
- </update>
-
- <update id="delete">
- UPDATE cm_page_big_topic a SET a.delFlag = #{delFlag}
- WHERE id = #{id}
- </update>
- <update id="updateEnabledStatusByIds">
- UPDATE cm_page_big_topic a SET a.enabledStatus = #{param1}
- WHERE a.id IN
- <foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
- #{id}
- </foreach>
- </update>
- <update id="updateCrmEnabledStatusByIds">
- UPDATE cm_page_big_topic a SET a.crmEnabledStatus = #{param1}
- WHERE a.id IN
- <foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
- #{id}
- </foreach>
- </update>
- </mapper>
|