|
@@ -1,167 +0,0 @@
|
|
|
-<?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.platform.dao.ApiSceneMapper">
|
|
|
-
|
|
|
- <!-- 可根据自己的需求,是否要使用 -->
|
|
|
- <resultMap type="com.platform.entity.BrandVo" id="brandMap">
|
|
|
- <result property="id" column="id"/>
|
|
|
- <result property="name" column="name"/>
|
|
|
- <result property="listPicUrl" column="list_pic_url"/>
|
|
|
- <result property="simpleDesc" column="simple_desc"/>
|
|
|
- <result property="picUrl" column="pic_url"/>
|
|
|
- <result property="sortOrder" column="sort_order"/>
|
|
|
- <result property="isShow" column="is_show"/>
|
|
|
- <result property="floorPrice" column="floor_price"/>
|
|
|
- <result property="appListPicUrl" column="app_list_pic_url"/>
|
|
|
- <result property="isNew" column="is_new"/>
|
|
|
- <result property="newPicUrl" column="new_pic_url"/>
|
|
|
- <result property="newSortOrder" column="new_sort_order"/>
|
|
|
- <result property="type" column="type"/>
|
|
|
- <result property="sceneUrl" column="scene_url"/>
|
|
|
- <result property="sceneNum" column="scene_num"/>
|
|
|
- <result property="shareWxQrCode" column="share_wx_qr_code"/>
|
|
|
- <result property="address" column="address"/>
|
|
|
- <result property="retailPrice" column="retail_price"/>
|
|
|
- <result property="averagePrice" column="average_price"/>
|
|
|
- <result property="pvTotalNum" column="pv_total_num"/>
|
|
|
- <result property="liveRoomUrl" column="live_room_url"/>
|
|
|
- <result property="sceneName" column="scene_name"/>
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <select id="queryIdByScene" resultType="java.lang.Integer">
|
|
|
- select
|
|
|
- `id`
|
|
|
- from nideshop_scene
|
|
|
- where scene_num = #{sceneNum}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="queryByScene" resultMap="brandMap">
|
|
|
- select
|
|
|
- *
|
|
|
- from nideshop_scene
|
|
|
- where scene_num = #{sceneNum}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="queryObject" resultMap="brandMap">
|
|
|
- select * from nideshop_scene where id = #{value}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="queryList" resultMap="brandMap">
|
|
|
- select
|
|
|
- <if test="fields != null and fields != ''">
|
|
|
- ${fields}
|
|
|
- </if>
|
|
|
- <if test="fields == null or fields == ''">
|
|
|
- *
|
|
|
- </if>
|
|
|
- from nideshop_scene
|
|
|
- <where>
|
|
|
- <if test="isShow != null">
|
|
|
- and is_show = #{isShow}
|
|
|
- </if>
|
|
|
- <if test="userId != null">
|
|
|
- and create_user_id = #{userId}
|
|
|
- </if>
|
|
|
- <if test="name != null and name!=''">
|
|
|
- and name like concat('%',#{name},'%')
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- <choose>
|
|
|
- <when test="sidx != null and sidx.trim() != ''">
|
|
|
- order by ${sidx} ${order}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- order by nideshop_scene.id desc
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- <if test="offset != null and limit != null">
|
|
|
- limit #{offset}, #{limit}
|
|
|
- </if>
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="queryTotal" resultType="int">
|
|
|
- select count(*) from nideshop_scene
|
|
|
- where is_show = 1
|
|
|
- <if test="name != null">
|
|
|
- and name like concat('%',#{name},'%')
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="save" parameterType="com.platform.entity.BrandVo" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into nideshop_scene
|
|
|
- (
|
|
|
- `name`,
|
|
|
- `list_pic_url`,
|
|
|
- `simple_desc`,
|
|
|
- `pic_url`,
|
|
|
- `sort_order`,
|
|
|
- `is_show`,
|
|
|
- `floor_price`,
|
|
|
- `app_list_pic_url`,
|
|
|
- `is_new`,
|
|
|
- `new_pic_url`,
|
|
|
- `new_sort_order`,
|
|
|
- `type`,
|
|
|
- `scene_url`,
|
|
|
- `scene_num`,
|
|
|
- `share_wx_qr_code`
|
|
|
- )
|
|
|
- values
|
|
|
- (
|
|
|
- #{name},
|
|
|
- #{listPicUrl},
|
|
|
- #{simpleDesc},
|
|
|
- #{picUrl},
|
|
|
- #{sortOrder},
|
|
|
- #{isShow},
|
|
|
- #{floorPrice},
|
|
|
- #{appListPicUrl},
|
|
|
- #{isNew},
|
|
|
- #{newPicUrl},
|
|
|
- #{newSortOrder},
|
|
|
- #{type},
|
|
|
- #{sceneUrl},
|
|
|
- #{sceneNum},
|
|
|
- #{shareWxQrCode}
|
|
|
- )
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="update" parameterType="com.platform.entity.BrandVo">
|
|
|
- update nideshop_scene
|
|
|
- <set>
|
|
|
- <if test="name != null">`name` = #{name},</if>
|
|
|
- <if test="is_show != null">`is_show` = #{is_show},</if>
|
|
|
- <if test="sceneNum != null">`scene_num` = #{sceneNum},</if>
|
|
|
- <if test="sceneUrl != null">`scene_url` = #{sceneUrl}</if>
|
|
|
- </set>
|
|
|
- where id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="delete">
|
|
|
- update nideshop_scene set deleted = 1 where id = #{value}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteBatch">
|
|
|
- update nideshop_scene set deleted = 1 where id in
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-
|
|
|
- <select id="getRecommondDeptBrand" resultType="com.platform.entity.BrandVo">
|
|
|
- select dept.logo_url appListPicUrl,dept.dept_id id,dept.name from sys_dept dept
|
|
|
- join nideshop_scene brand on dept.dept_id = brand.create_user_dept_id
|
|
|
- group by dept.dept_id order by count(*) desc limit 0,3
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="increaseViewCount">
|
|
|
- update nideshop_scene set pv_total_num = pv_total_num + 1 where id= #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getTopPvNumByDeptId" resultType="java.lang.Integer">
|
|
|
- select id from nideshop_scene brand where create_user_dept_id = #{deptId} order by pv_total_num desc limit 1
|
|
|
- </select>
|
|
|
-
|
|
|
-</mapper>
|