123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <?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.newhome.dao.NewPageFloorDao">
-
- <sql id="newPageFloorColumns">
- a.id AS "id",
- a.floorTitle AS "floorTitle",
- a.floorDetail AS "floorDetail",
- a.type AS "type",
- a.sort AS "sort",
- a.wwwEnabledStatus AS "wwwEnabledStatus",
- 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="newPageFloorJoins">
- </sql>
-
- <select id="get" resultType="NewPageFloor">
- SELECT
- <include refid="newPageFloorColumns"/>
- FROM new_page_floor a
- <include refid="newPageFloorJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultType="NewPageFloor">
- SELECT
- <include refid="newPageFloorColumns"/>
- FROM new_page_floor a
- <include refid="newPageFloorJoins"/>
- <where>
- AND delFlag = 0
- </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="NewPageFloor">
- SELECT
- <include refid="newPageFloorColumns"/>
- FROM new_page_floor a
- <include refid="newPageFloorJoins"/>
- <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="NewPageFloor" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO new_page_floor(
- floorTitle,
- floorDetail,
- type,
- <if test="sort != null and sort != ''" >
- sort,
- </if>
- wwwEnabledStatus,
- crmEnabledStatus,
- createBy,
- createDate,
- updateBy,
- updateDate,
- delFlag
- ) VALUES (
- #{floorTitle},
- #{floorDetail},
- #{type},
- <if test="sort != null and sort != ''" >
- #{sort},
- </if>
- #{wwwEnabledStatus},
- #{crmEnabledStatus},
- #{createBy.id},
- #{createDate},
- #{updateBy.id},
- #{updateDate},
- #{delFlag}
- )
- </insert>
-
- <update id="update">
- UPDATE new_page_floor SET
- floorTitle = #{floorTitle},
- floorDetail = #{floorDetail},
- type = #{type},
- sort = #{sort},
- wwwEnabledStatus = #{wwwEnabledStatus},
- crmEnabledStatus = #{crmEnabledStatus},
- createBy = #{createBy.id},
- createDate = #{createDate},
- updateBy = #{updateBy.id},
- updateDate = #{updateDate},
- delFlag = #{delFlag}
- WHERE id = #{id}
- </update>
-
- <delete id="delete">
- UPDATE new_page_floor SET delFlag = 1
- WHERE id = #{id}
- </delete>
- <update id="updateEnabledStatusByIds">
- UPDATE new_page_floor a SET a.wwwEnabledStatus = #{param1}
- WHERE a.id IN
- <foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
- #{id}
- </foreach>
- </update>
- <update id="updateCrmEnabledStatusByIds">
- UPDATE new_page_floor a SET a.crmEnabledStatus = #{param1}
- WHERE a.id IN
- <foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
- #{id}
- </foreach>
- </update>
- <update id="saveSort">
- UPDATE new_page_floor SET
- sort = #{sort}
- WHERE id = #{id}
- </update>
- <select id="findFloorContentByfloorId" resultType="com.caimei.modules.newhome.entity.NewPageFloorContent">
- SELECT
- npfc.*,
- npf.floorTitle AS floorTitle
- FROM
- new_page_floor npf
- LEFT JOIN new_page_floor_content npfc ON npfc.floorId = npf.id
- WHERE
- npf.id = #{floorId}
- </select>
- <select id="findFloorImage" resultType="com.caimei.modules.newhome.entity.NewPageFloorImage">
- SELECT
- id,
- floorId,
- productId,
- `name`,
- content,
- link,
- image,
- appletsImage,
- adsImage,
- `label`,
- pcStatus,
- appletsStatus,
- sort,
- DATE_FORMAT(createDate,'%Y-%m-%d %H:%i:%S') AS createDate
- FROM
- new_page_floor_image
- WHERE
- floorId = #{floorId}
- </select>
- <insert id="insertFloorContent">
- INSERT INTO `new_page_floor_content` (
- `floorId`, `templateType`, `pcAdsImage1`,
- `pcAdsImage2`, `pcAdsImage3`, `pcAdsImage4`, `pcAdsImage5`, `appletsAdsImage1`,
- `appletsAdsImage2`, `appletsAdsImage3`,`appletsAdsImage4`, `appletsAdsImage5`,adsLink1,
- adsLink2, adsLink3,adsLink4, adsLink5, centreId
- )
- VALUES
- (
- #{floorId}, #{templateType}, #{pcAdsImage1},
- #{pcAdsImage2}, #{pcAdsImage3},#{pcAdsImage4}, #{pcAdsImage5}, #{appletsAdsImage1},
- #{appletsAdsImage2}, #{appletsAdsImage3}, #{appletsAdsImage4}, #{appletsAdsImage5}, #{adsLink1},
- #{adsLink2}, #{adsLink3}, #{adsLink4}, #{adsLink5}, #{centreId}
- )
- </insert>
- <update id="updateFloorContent">
- UPDATE
- `new_page_floor_content`
- SET
- `floorId` = #{floorId},
- `centreId` = #{centreId},
- `templateType` = #{templateType},
- `pcAdsImage1` = #{pcAdsImage1},
- `pcAdsImage2` = #{pcAdsImage2},
- `pcAdsImage3` = #{pcAdsImage3},
- `pcAdsImage4` = #{pcAdsImage4},
- `pcAdsImage5` = #{pcAdsImage5},
- `appletsAdsImage1` = #{appletsAdsImage1},
- `appletsAdsImage2` = #{appletsAdsImage2},
- `appletsAdsImage3` = #{appletsAdsImage3},
- `appletsAdsImage4` = #{appletsAdsImage4},
- `appletsAdsImage5` = #{appletsAdsImage5},
- `adsLink1` = #{adsLink1},
- `adsLink2` = #{adsLink2},
- `adsLink3` = #{adsLink3},
- `adsLink4` = #{adsLink4},
- `adsLink5` = #{adsLink5}
- WHERE `id` = #{id}
- </update>
- <delete id="deleteFloorImage">
- DELETE FROM
- new_page_floor_image
- WHERE
- <if test="status == 1">
- floorId = #{floorId}
- </if>
- <if test="status == 2">
- centreId = #{floorId}
- </if>
- </delete>
- <insert id="insertFloorImage">
- INSERT INTO `new_page_floor_image` (
- `floorId`, `productId`, `name`, `link`,
- `image`,`appletsImage`, `adsImage`, `label`, `content`, `pcStatus`, `appletsStatus`,
- `sort`, `createDate`, centreId
- )
- VALUES
- (
- #{floorId}, #{productId}, #{name}, #{link},
- #{image},#{appletsImage}, #{adsImage}, #{label}, #{content}, #{pcStatus}, #{appletsStatus},
- #{sort}, #{createDate}, #{centreId}
- )
- </insert>
-
- </mapper>
|