<?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.SuperHomeNavbarMapper">
|
|
<resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar">
|
<id column="sp_id" property="id" jdbcType="BIGINT"/>
|
|
<association property="homeNavbar" column="sp_navbar_id"
|
select="com.yeshi.fanli.dao.mybatis.homemodule.HomeNavbarMapper.selectByPrimaryKey">
|
</association>
|
|
<association property="system" column="sp_system_id"
|
select="com.yeshi.fanli.dao.mybatis.SystemMapper.selectByPrimaryKey">
|
</association>
|
|
|
</resultMap>
|
|
<sql id="Base_Column_List">sp_id,sp_navbar_id,sp_system_id</sql>
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/>from yeshi_ec_super_homenavbar where sp_id = #{id,jdbcType=BIGINT}
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_super_homenavbar where sp_id = #{id,jdbcType=BIGINT}</delete>
|
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_super_homenavbar (sp_id,sp_navbar_id,sp_system_id) values (#{id,jdbcType=BIGINT},#{homeNavbar.id,jdbcType=BIGINT},#{system.id,jdbcType=BIGINT})</insert>
|
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_super_homenavbar
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">sp_id,</if>
|
<if test="homeNavbar != null">sp_navbar_id,</if>
|
<if test="system != null">sp_system_id,</if>
|
</trim>values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="homeNavbar != null">#{homeNavbar.id,jdbcType=BIGINT},</if>
|
<if test="system != null">#{system.id,jdbcType=BIGINT},</if>
|
</trim>
|
</insert>
|
|
<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar">update yeshi_ec_super_homenavbar set sp_navbar_id = #{homeNavbar.id,jdbcType=BIGINT},sp_system_id = #{system.id,jdbcType=BIGINT} where sp_id = #{id,jdbcType=BIGINT}</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar">
|
update yeshi_ec_super_homenavbar
|
<set>
|
<if test="homeNavbar != null">sp_navbar_id=#{homeNavbar.id,jdbcType=BIGINT},</if>
|
<if test="system != null">sp_system_id=#{system.id,jdbcType=BIGINT},</if>
|
</set> where sp_id = #{id,jdbcType=BIGINT}
|
</update>
|
|
<select id="listBySystem" resultMap="BaseResultMap">
|
SELECT <include refid="Base_Column_List"/> FROM `yeshi_ec_super_homenavbar` ss
|
LEFT JOIN yeshi_ec_home_navbar nb ON nb.`br_id`= ss.`sp_navbar_id`
|
WHERE ss.sp_system_id = #{systemId}
|
ORDER BY nb.`br_orderby`
|
</select>
|
|
|
<select id="listByNavbarIds" parameterType="java.util.List" resultMap="BaseResultMap">
|
SELECT <include refid="Base_Column_List"/> FROM `yeshi_ec_super_homenavbar`
|
WHERE sp_navbar_id in <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach>
|
</select>
|
|
<delete id="deleteBatchByNavbarIds" parameterType="java.util.List">
|
delete from yeshi_ec_super_homenavbar WHERE sp_navbar_id in
|
<foreach collection="list" item="item" open="(" close=")"
|
separator=",">#{item}</foreach>
|
</delete>
|
|
<select id="querybyNavbarId" resultMap="BaseResultMap">
|
SELECT * FROM `yeshi_ec_super_homenavbar` WHERE sp_navbar_id = #{navbarId} and sp_system_id = #{systemId}
|
</select>
|
|
<delete id="deletebyNavbarId">
|
delete from yeshi_ec_super_homenavbar WHERE sp_navbar_id = #{navbarId} and sp_system_id = #{systemId}
|
</delete>
|
|
</mapper>
|