Administrator
2018-10-30 c0c91fbda1ba601c4c8cb6d12fd43dfbe02eea5d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?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>
  
  
</mapper>