| | |
| | | <?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.yeshi.fanli.dao.mybatis.homemodule.HomeNavbarMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar"> |
| | | <id column="br_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="br_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="br_picture" property="picture" jdbcType="VARCHAR"/> |
| | | <result column="br_class_id" property="classId" jdbcType="BIGINT"/> |
| | | <result column="br_swiper_banner_id" property="swiperBannerId" jdbcType="BIGINT"/> |
| | | <result column="br_url" property="url" jdbcType="VARCHAR"/> |
| | | <result column="br_type" property="type" jdbcType="VARCHAR"/> |
| | | <result column="br_orderby" property="orderby" jdbcType="INTEGER"/> |
| | | <result column="br_order_man" property="orderMan" jdbcType="INTEGER"/> |
| | | <result column="br_order_woman" property="orderWoman" jdbcType="INTEGER"/> |
| | | <result column="br_start_time" property="startTime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="br_is_default" property="isDefault" jdbcType="VARCHAR"/> |
| | | <result column="br_is_fixed" property="isFixed" jdbcType="VARCHAR"/> |
| | | <result column="br_createtime" property="createtime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.NavbarTypeEnumHandler"/> |
| | | |
| | | <result column="sex" property="sex" jdbcType="INTEGER"/> |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime</sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="getDefaultMaxOrder" resultType="java.lang.Integer"> |
| | | SELECT IFNULL(MAX(br_orderby),0) FROM yeshi_ec_home_navbar |
| | | order by br_orderby desc |
| | | </select> |
| | | |
| | | <select id="getManMaxOrder" resultType="java.lang.Integer"> |
| | | SELECT IFNULL(MAX(br_order_man),0) FROM yeshi_ec_home_navbar |
| | | order by br_order_man desc |
| | | </select> |
| | | |
| | | <select id="getWomanMaxOrder" resultType="java.lang.Integer"> |
| | | SELECT IFNULL(MAX(br_order_woman),0) FROM yeshi_ec_home_navbar |
| | | order by br_order_woman desc |
| | | </select> |
| | | |
| | | |
| | | <select id="getDefaultChangeOrder" resultMap="BaseResultMap"> |
| | | SELECT h.* FROM yeshi_ec_home_navbar h |
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id` |
| | | WHERE 1=1 and h.br_orderby is not null |
| | | <if test="type == -1"> |
| | | <![CDATA[and h.br_orderby < #{order}]]> |
| | | order by h.br_orderby desc |
| | | </if> |
| | | <if test="type == 1"> |
| | | <![CDATA[and h.br_orderby > #{order}]]> |
| | | order by h.br_orderby |
| | | </if> |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getManChangeOrder" resultMap="BaseResultMap"> |
| | | SELECT h.* FROM yeshi_ec_home_navbar h |
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id` |
| | | WHERE 1=1 and h.br_order_man is not null |
| | | <if test="type == -1"> |
| | | <![CDATA[and h.br_order_man < #{order}]]> |
| | | order by h.br_order_man desc |
| | | </if> |
| | | <if test="type == 1"> |
| | | <![CDATA[and h.br_order_man > #{order}]]> |
| | | order by h.br_order_man |
| | | </if> |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getWomanChangeOrder" resultMap="BaseResultMap"> |
| | | SELECT h.* FROM yeshi_ec_home_navbar h |
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id` |
| | | WHERE 1=1 and h.br_order_woman is not null |
| | | <if test="type == -1"> |
| | | <![CDATA[and h.br_order_woman < #{order}]]> |
| | | order by h.br_order_woman desc |
| | | </if> |
| | | <if test="type == 1"> |
| | | <![CDATA[and h.br_order_woman > #{order}]]> |
| | | order by h.br_order_woman |
| | | </if> |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="listQuery" resultMap="BaseResultMap"> |
| | | SELECT h.*,c.sex AS sex FROM yeshi_ec_home_navbar h |
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id` |
| | | WHERE 1=1 |
| | | <if test='key != null and key != ""'> |
| | | AND (h.br_name like '%${key}%') |
| | | </if> |
| | | <!-- 通用版 --> |
| | | <if test="sex == 0"> |
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20)) |
| | | ORDER BY h.br_orderby |
| | | </if> |
| | | <!-- 女版 --> |
| | | <if test="sex == 1"> |
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12)) |
| | | ORDER BY h.br_order_woman |
| | | </if> |
| | | <!-- 男版 --> |
| | | <if test="sex == 2"> |
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12)) |
| | | ORDER BY h.br_order_man |
| | | </if> |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countListQuery" resultType="java.lang.Long"> |
| | | SELECT IFNULL(count(br_id),0) FROM yeshi_ec_home_navbar h |
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id` |
| | | WHERE 1=1 |
| | | <if test='key != null and key != ""'> |
| | | AND (h.br_name like '%${key}%') |
| | | </if> |
| | | <!-- 通用版 --> |
| | | <if test="sex == 0"> |
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20)) |
| | | ORDER BY h.br_orderby |
| | | </if> |
| | | <!-- 女版 --> |
| | | <if test="sex == 1"> |
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12)) |
| | | ORDER BY h.br_order_woman |
| | | </if> |
| | | <!-- 男版 --> |
| | | <if test="sex == 2"> |
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12)) |
| | | ORDER BY h.br_order_man |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="listQueryEffective" resultMap="BaseResultMap"> |
| | | SELECT h.*,c.sex AS sex FROM yeshi_ec_home_navbar h |
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id` |
| | | WHERE h.br_state = 1 |
| | | AND IF(h.br_start_time IS NULL,TRUE, h.br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(h.br_end_time IS NULL,TRUE, h.br_end_time <![CDATA[>=]]> NOW()) |
| | | ORDER BY h.br_orderby |
| | | </select> |
| | | |
| | | |
| | | <select id="listQueryDefaultNavbar" resultMap="BaseResultMap"> |
| | | SELECT h.*,c.sex AS sex FROM yeshi_ec_home_navbar h |
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id` |
| | | WHERE h.br_state = 1 AND br_is_default = 1 |
| | | AND IF(h.br_start_time IS NULL,TRUE, h.br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(h.br_end_time IS NULL,TRUE, h.br_end_time <![CDATA[>=]]> NOW()) |
| | | <!-- 通用版 --> |
| | | <if test="sex == 0"> |
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20)) |
| | | ORDER BY h.br_orderby |
| | | </if> |
| | | <!-- 女版 --> |
| | | <if test="sex == 1"> |
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12)) |
| | | ORDER BY h.br_order_woman |
| | | </if> |
| | | <!-- 男版 --> |
| | | <if test="sex == 2"> |
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12)) |
| | | ORDER BY h.br_order_man |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="listQueryFixedNavbar" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_home_navbar |
| | | WHERE br_state = 1 AND br_is_default = 1 AND br_is_fixed = 1 |
| | | AND IF(br_start_time IS NULL,TRUE, br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(br_end_time IS NULL,TRUE, br_end_time <![CDATA[>=]]> NOW()) |
| | | ORDER BY br_orderby |
| | | </select> |
| | | |
| | | <select id="getEffectiveByClassId" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_home_navbar |
| | | WHERE br_state = 1 AND br_class_id = #{classId} |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List"> |
| | | delete from yeshi_ec_home_navbar WHERE br_id in |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=VARCHAR},#{isFixed,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> |
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">br_id,</if> |
| | | <if test="name != null">br_name,</if> |
| | | <if test="picture != null">br_picture,</if> |
| | | <if test="classId != null">br_class_id,</if> |
| | | <if test="swiperBannerId != null">br_swiper_banner_id,</if> |
| | | <if test="url != null">br_url,</if> |
| | | <if test="type != null">br_type,</if> |
| | | <if test="orderby != null">br_orderby,</if> |
| | | <if test="orderMan != null">br_order_man,</if> |
| | | <if test="orderWoman != null">br_order_woman,</if> |
| | | <if test="startTime != null">br_start_time,</if> |
| | | <if test="endTime != null">br_end_time,</if> |
| | | <if test="state != null">br_state,</if> |
| | | <if test="isDefault != null">br_is_default,</if> |
| | | <if test="isFixed != null">br_is_fixed,</if> |
| | | <if test="createtime != null">br_createtime,</if> |
| | | <if test="updatetime != null">br_updatetime,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="classId != null">#{classId,jdbcType=BIGINT},</if> |
| | | <if test="swiperBannerId != null">#{swiperBannerId,jdbcType=BIGINT},</if> |
| | | <if test="url != null">#{url,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if> |
| | | <if test="orderMan != null">#{orderMan,jdbcType=INTEGER},</if> |
| | | <if test="orderWoman != null">#{orderWoman,jdbcType=INTEGER},</if> |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="isDefault != null">#{isDefault,jdbcType=VARCHAR},</if> |
| | | <if test="isFixed != null">#{isFixed,jdbcType=VARCHAR},</if> |
| | | <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_order_man = #{orderMan,jdbcType=INTEGER},br_order_woman = #{orderWoman,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=VARCHAR},br_is_fixed = #{isFixed,jdbcType=VARCHAR},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update> |
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar |
| | | <set> |
| | | <if test="name != null">br_name=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="picture != null">br_picture=#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="classId != null">br_class_id=#{classId,jdbcType=BIGINT},</if> |
| | | <if test="swiperBannerId != null">br_swiper_banner_id=#{swiperBannerId,jdbcType=BIGINT},</if> |
| | | <if test="url != null">br_url=#{url,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">br_type=#{type,jdbcType=VARCHAR},</if> |
| | | <if test="orderby != null">br_orderby=#{orderby,jdbcType=INTEGER},</if> |
| | | <if test="orderMan != null">br_order_man=#{orderMan,jdbcType=INTEGER},</if> |
| | | <if test="orderWoman != null">br_order_woman=#{orderWoman,jdbcType=INTEGER},</if> |
| | | <if test="startTime != null">br_start_time=#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">br_end_time=#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">br_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="isDefault != null">br_is_default=#{isDefault,jdbcType=VARCHAR},</if> |
| | | <if test="isFixed != null">br_is_fixed=#{isFixed,jdbcType=VARCHAR},</if> |
| | | <if test="createtime != null">br_createtime=#{createtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatetime != null">br_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | </set> where br_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | | <?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.yeshi.fanli.dao.mybatis.homemodule.HomeNavbarMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">
|
| | | <id column="br_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="br_name" property="name" jdbcType="VARCHAR"/>
|
| | | <result column="br_picture" property="picture" jdbcType="VARCHAR"/>
|
| | | <result column="br_class_id" property="classId" jdbcType="BIGINT"/>
|
| | | <result column="br_swiper_banner_id" property="swiperBannerId" jdbcType="BIGINT"/>
|
| | | <result column="br_url" property="url" jdbcType="VARCHAR"/>
|
| | | <result column="br_type" property="type" jdbcType="VARCHAR"/>
|
| | | <result column="br_orderby" property="orderby" jdbcType="INTEGER"/>
|
| | | <result column="br_order_man" property="orderMan" jdbcType="INTEGER"/>
|
| | | <result column="br_order_woman" property="orderWoman" jdbcType="INTEGER"/>
|
| | | <result column="br_start_time" property="startTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="br_end_time" property="endTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="br_state" property="state" jdbcType="INTEGER"/>
|
| | | <result column="br_is_default" property="isDefault" jdbcType="VARCHAR"/>
|
| | | <result column="br_is_fixed" property="isFixed" jdbcType="VARCHAR"/>
|
| | | <result column="br_params" property="params" jdbcType="VARCHAR"/>
|
| | | <result column="br_createtime" property="createtime" jdbcType="TIMESTAMP"/>
|
| | | <result column="br_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
|
| | | <result column="br_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.NavbarTypeEnumHandler"/>
|
| | | |
| | | <result column="sex" property="sex" jdbcType="INTEGER"/>
|
| | | |
| | | </resultMap>
|
| | | |
| | | |
| | | <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_params,br_createtime,br_updatetime</sql>
|
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | |
| | | |
| | | <select id="getDefaultMaxOrder" resultType="java.lang.Integer">
|
| | | SELECT IFNULL(MAX(br_orderby),0) FROM yeshi_ec_home_navbar
|
| | | order by br_orderby desc
|
| | | </select>
|
| | | |
| | | <select id="getManMaxOrder" resultType="java.lang.Integer">
|
| | | SELECT IFNULL(MAX(br_order_man),0) FROM yeshi_ec_home_navbar
|
| | | order by br_order_man desc
|
| | | </select>
|
| | | |
| | | <select id="getWomanMaxOrder" resultType="java.lang.Integer">
|
| | | SELECT IFNULL(MAX(br_order_woman),0) FROM yeshi_ec_home_navbar
|
| | | order by br_order_woman desc
|
| | | </select>
|
| | | |
| | | |
| | | <select id="getDefaultChangeOrder" resultMap="BaseResultMap">
|
| | | SELECT h.* FROM yeshi_ec_home_navbar h
|
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
|
| | | WHERE 1=1 and h.br_orderby is not null
|
| | | <if test="type == -1">
|
| | | <![CDATA[and h.br_orderby < #{order}]]> |
| | | order by h.br_orderby desc
|
| | | </if>
|
| | | <if test="type == 1">
|
| | | <![CDATA[and h.br_orderby > #{order}]]> |
| | | order by h.br_orderby |
| | | </if>
|
| | | LIMIT 1
|
| | | </select>
|
| | | |
| | | <select id="getManChangeOrder" resultMap="BaseResultMap">
|
| | | SELECT h.* FROM yeshi_ec_home_navbar h
|
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
|
| | | WHERE 1=1 and h.br_order_man is not null
|
| | | <if test="type == -1">
|
| | | <![CDATA[and h.br_order_man < #{order}]]> |
| | | order by h.br_order_man desc
|
| | | </if>
|
| | | <if test="type == 1">
|
| | | <![CDATA[and h.br_order_man > #{order}]]> |
| | | order by h.br_order_man |
| | | </if>
|
| | | LIMIT 1
|
| | | </select>
|
| | | |
| | | <select id="getWomanChangeOrder" resultMap="BaseResultMap">
|
| | | SELECT h.* FROM yeshi_ec_home_navbar h
|
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
|
| | | WHERE 1=1 and h.br_order_woman is not null
|
| | | <if test="type == -1">
|
| | | <![CDATA[and h.br_order_woman < #{order}]]> |
| | | order by h.br_order_woman desc
|
| | | </if>
|
| | | <if test="type == 1">
|
| | | <![CDATA[and h.br_order_woman > #{order}]]> |
| | | order by h.br_order_woman |
| | | </if>
|
| | | LIMIT 1
|
| | | </select>
|
| | | |
| | | |
| | | <select id="listQuery" resultMap="BaseResultMap">
|
| | | SELECT h.*,c.sex AS sex FROM yeshi_ec_home_navbar h
|
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
|
| | | WHERE 1=1
|
| | | <if test='key != null and key != ""'>
|
| | | AND (h.br_name like '%${key}%') |
| | | </if>
|
| | | <!-- 通用版 -->
|
| | | <if test="sex == 0">
|
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20))
|
| | | ORDER BY h.br_orderby |
| | | </if>
|
| | | <!-- 女版 -->
|
| | | <if test="sex == 1">
|
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12))
|
| | | ORDER BY h.br_order_woman
|
| | | </if>
|
| | | <!-- 男版 -->
|
| | | <if test="sex == 2">
|
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12))
|
| | | ORDER BY h.br_order_man |
| | | </if>
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | | |
| | | <select id="countListQuery" resultType="java.lang.Long">
|
| | | SELECT IFNULL(count(br_id),0) FROM yeshi_ec_home_navbar h
|
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
|
| | | WHERE 1=1
|
| | | <if test='key != null and key != ""'>
|
| | | AND (h.br_name like '%${key}%') |
| | | </if>
|
| | | <!-- 通用版 -->
|
| | | <if test="sex == 0">
|
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20))
|
| | | ORDER BY h.br_orderby |
| | | </if>
|
| | | <!-- 女版 -->
|
| | | <if test="sex == 1">
|
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12))
|
| | | ORDER BY h.br_order_woman
|
| | | </if>
|
| | | <!-- 男版 -->
|
| | | <if test="sex == 2">
|
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12))
|
| | | ORDER BY h.br_order_man |
| | | </if>
|
| | | </select>
|
| | | |
| | | <select id="listQueryEffective" resultMap="BaseResultMap">
|
| | | SELECT h.*,c.sex AS sex FROM yeshi_ec_home_navbar h
|
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
|
| | | WHERE h.br_state = 1
|
| | | AND IF(h.br_start_time IS NULL,TRUE, h.br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(h.br_end_time IS NULL,TRUE, h.br_end_time <![CDATA[>=]]> NOW())
|
| | | ORDER BY h.br_orderby |
| | | </select>
|
| | | |
| | | |
| | | <select id="listQueryDefaultNavbar" resultMap="BaseResultMap">
|
| | | SELECT h.*,c.sex AS sex FROM yeshi_ec_home_navbar h
|
| | | LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
|
| | | WHERE h.br_state = 1 AND br_is_default = 1
|
| | | AND IF(h.br_start_time IS NULL,TRUE, h.br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(h.br_end_time IS NULL,TRUE, h.br_end_time <![CDATA[>=]]> NOW())
|
| | | <!-- 通用版 -->
|
| | | <if test="sex == 0">
|
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20))
|
| | | ORDER BY h.br_orderby |
| | | </if>
|
| | | <!-- 女版 -->
|
| | | <if test="sex == 1">
|
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12))
|
| | | ORDER BY h.br_order_woman
|
| | | </if>
|
| | | <!-- 男版 -->
|
| | | <if test="sex == 2">
|
| | | AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12))
|
| | | ORDER BY h.br_order_man |
| | | </if>
|
| | | </select>
|
| | | |
| | | <select id="listQueryFixedNavbar" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_home_navbar |
| | | WHERE br_state = 1 AND br_is_default = 1 AND br_is_fixed = 1
|
| | | AND IF(br_start_time IS NULL,TRUE, br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(br_end_time IS NULL,TRUE, br_end_time <![CDATA[>=]]> NOW())
|
| | | ORDER BY br_orderby
|
| | | </select>
|
| | | |
| | | <select id="getEffectiveByClassId" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_home_navbar |
| | | WHERE br_state = 1 AND br_class_id = #{classId}
|
| | | LIMIT 1
|
| | | </select>
|
| | | |
| | | <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
|
| | | delete from yeshi_ec_home_navbar WHERE br_id in
|
| | | <foreach collection="list" item="item" open="(" close=")"
|
| | | separator=",">#{item}</foreach>
|
| | | </delete>
|
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
| | | delete from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_params,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=VARCHAR},#{isFixed,jdbcType=VARCHAR},#{params,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
|
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">br_id,</if>
|
| | | <if test="name != null">br_name,</if>
|
| | | <if test="picture != null">br_picture,</if>
|
| | | <if test="classId != null">br_class_id,</if>
|
| | | <if test="swiperBannerId != null">br_swiper_banner_id,</if>
|
| | | <if test="url != null">br_url,</if>
|
| | | <if test="type != null">br_type,</if>
|
| | | <if test="orderby != null">br_orderby,</if>
|
| | | <if test="orderMan != null">br_order_man,</if>
|
| | | <if test="orderWoman != null">br_order_woman,</if>
|
| | | <if test="startTime != null">br_start_time,</if>
|
| | | <if test="endTime != null">br_end_time,</if>
|
| | | <if test="state != null">br_state,</if>
|
| | | <if test="isDefault != null">br_is_default,</if>
|
| | | <if test="isFixed != null">br_is_fixed,</if>
|
| | | <if test="params != null">br_params,</if>
|
| | | <if test="createtime != null">br_createtime,</if>
|
| | | <if test="updatetime != null">br_updatetime,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if>
|
| | | <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
|
| | | <if test="classId != null">#{classId,jdbcType=BIGINT},</if>
|
| | | <if test="swiperBannerId != null">#{swiperBannerId,jdbcType=BIGINT},</if>
|
| | | <if test="url != null">#{url,jdbcType=VARCHAR},</if>
|
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if>
|
| | | <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
|
| | | <if test="orderMan != null">#{orderMan,jdbcType=INTEGER},</if>
|
| | | <if test="orderWoman != null">#{orderWoman,jdbcType=INTEGER},</if>
|
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if>
|
| | | <if test="isDefault != null">#{isDefault,jdbcType=VARCHAR},</if>
|
| | | <if test="isFixed != null">#{isFixed,jdbcType=VARCHAR},</if>
|
| | | <if test="params != null">#{params,jdbcType=VARCHAR},</if>
|
| | | <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_order_man = #{orderMan,jdbcType=INTEGER},br_order_woman = #{orderWoman,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=VARCHAR},br_is_fixed = #{isFixed,jdbcType=VARCHAR},br_params = #{params,jdbcType=VARCHAR},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update>
|
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar
|
| | | <set>
|
| | | <if test="name != null">br_name=#{name,jdbcType=VARCHAR},</if>
|
| | | <if test="picture != null">br_picture=#{picture,jdbcType=VARCHAR},</if>
|
| | | <if test="classId != null">br_class_id=#{classId,jdbcType=BIGINT},</if>
|
| | | <if test="swiperBannerId != null">br_swiper_banner_id=#{swiperBannerId,jdbcType=BIGINT},</if>
|
| | | <if test="url != null">br_url=#{url,jdbcType=VARCHAR},</if>
|
| | | <if test="type != null">br_type=#{type,jdbcType=VARCHAR},</if>
|
| | | <if test="orderby != null">br_orderby=#{orderby,jdbcType=INTEGER},</if>
|
| | | <if test="orderMan != null">br_order_man=#{orderMan,jdbcType=INTEGER},</if>
|
| | | <if test="orderWoman != null">br_order_woman=#{orderWoman,jdbcType=INTEGER},</if>
|
| | | <if test="startTime != null">br_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="endTime != null">br_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="state != null">br_state=#{state,jdbcType=INTEGER},</if>
|
| | | <if test="isDefault != null">br_is_default=#{isDefault,jdbcType=VARCHAR},</if>
|
| | | <if test="isFixed != null">br_is_fixed=#{isFixed,jdbcType=VARCHAR},</if>
|
| | | <if test="params != null">br_params=#{params,jdbcType=VARCHAR},</if>
|
| | | <if test="createtime != null">br_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updatetime != null">br_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where br_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | </mapper>
|