From 973abe9ae7abf712e370f582abb4a6d381096d9f Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 06 五月 2019 10:47:24 +0800
Subject: [PATCH] 分类修改

---
 fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml |  400 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 205 insertions(+), 195 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml
index 022b72e..faa1d4e 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml
@@ -2,199 +2,209 @@
 <!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.GoodsSubClassMapper">
-  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
-    <id column="sub_id" property="id" jdbcType="BIGINT"/>
-    <result column="sub_name" property="name" jdbcType="VARCHAR"/>
-    <result column="sub_picture" property="picture" jdbcType="VARCHAR"/>
-    <result column="sub_picture_second" property="pictureSecond" jdbcType="VARCHAR"/>
-    <result column="sub_weight" property="weight" jdbcType="INTEGER"/>
-    <result column="sub_level" property="level" jdbcType="INTEGER"/>
-    <result column="sub_state" property="state" jdbcType="INTEGER"/>
-    <result column="sub_key" property="key" jdbcType="VARCHAR"/>
-    <result column="sub_search_json" property="searchJson" jdbcType="VARCHAR"/>
-    <result column="sub_ios_click" property="iosClick" jdbcType="BIGINT"/>
-    <result column="sub_android_click" property="androidClick" jdbcType="BIGINT"/>
-    <result column="sub_createtime" property="createtime" jdbcType="TIMESTAMP"/>
-    <result column="sub_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
-    
-    <association property="rootClass" column="sub_root_id" 
-    	select="com.yeshi.fanli.dao.mybatis.GoodsClassMapper.selectByPrimaryKey"> 
-    </association>
-    
-    <association property="parent" column="sub_pid" 
-    	select="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.selectByPrimaryKey"> 
-    </association>
-    
-  </resultMap>
-  
-  <resultMap id="SimpleResultMap" type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
-    <id column="sub_id" property="id" jdbcType="BIGINT"/>
-    <result column="sub_name" property="name" jdbcType="VARCHAR"/>
-    <result column="sub_picture" property="picture" jdbcType="VARCHAR"/>
-    <result column="sub_picture_second" property="pictureSecond" jdbcType="VARCHAR"/>
-    <result column="sub_weight" property="weight" jdbcType="INTEGER"/>
-    <result column="sub_level" property="level" jdbcType="INTEGER"/>
-    <result column="sub_state" property="state" jdbcType="INTEGER"/>
-    <result column="sub_key" property="key" jdbcType="VARCHAR"/>
-    <result column="sub_search_json" property="searchJson" jdbcType="VARCHAR"/>
-    <result column="sub_ios_click" property="iosClick" jdbcType="BIGINT"/>
-    <result column="sub_android_click" property="androidClick" jdbcType="BIGINT"/>
-    <result column="sub_createtime" property="createtime" jdbcType="TIMESTAMP"/>
-    <result column="sub_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
-    
-    <association property="rootClass" column="sub_root_id" javaType="com.yeshi.fanli.entity.bus.clazz.GoodsClass">
-		<id column="sub_root_id" property="id" jdbcType="BIGINT" />	
-    </association>
-    
-    <association property="parent" column="sub_pid" javaType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
-		<id column="sub_pid" property="id" jdbcType="BIGINT" />	
-    </association>
-    
-  </resultMap>
-  
-  
-  <sql id="Base_Column_List">sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime</sql>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
-    <include refid="Base_Column_List"/>from yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}</delete>
-  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_sub_class (sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{pictureSecond,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{rootClass.id,jdbcType=BIGINT},#{parent.id,jdbcType=BIGINT},#{level,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{key,jdbcType=VARCHAR},#{searchJson,jdbcType=VARCHAR},#{iosClick,jdbcType=BIGINT},#{androidClick,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
-  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_sub_class
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">sub_id,</if>
-      <if test="name != null">sub_name,</if>
-      <if test="picture != null">sub_picture,</if>
-      <if test="pictureSecond != null">sub_picture_second,</if>
-      <if test="weight != null">sub_weight,</if>
-      <if test="rootClass != null">sub_root_id,</if>
-      <if test="parent != null">sub_pid,</if>
-      <if test="level != null">sub_level,</if>
-      <if test="state != null">sub_state,</if>
-      <if test="key != null">sub_key,</if>
-      <if test="searchJson != null">sub_search_json,</if>
-      <if test="iosClick != null">sub_ios_click,</if>
-      <if test="androidClick != null">sub_android_click,</if>
-      <if test="createtime != null">sub_createtime,</if>
-      <if test="updatetime != null">sub_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="pictureSecond != null">#{pictureSecond,jdbcType=VARCHAR},</if>
-      <if test="weight != null">#{weight,jdbcType=INTEGER},</if>
-      <if test="rootClass != null">#{rootClass.id,jdbcType=BIGINT},</if>
-      <if test="parent != null">#{parent.id,jdbcType=BIGINT},</if>
-      <if test="level != null">#{level,jdbcType=INTEGER},</if>
-      <if test="state != null">#{state,jdbcType=INTEGER},</if>
-      <if test="key != null">#{key,jdbcType=VARCHAR},</if>
-      <if test="searchJson != null">#{searchJson,jdbcType=VARCHAR},</if>
-      <if test="iosClick != null">#{iosClick,jdbcType=BIGINT},</if>
-      <if test="androidClick != null">#{androidClick,jdbcType=BIGINT},</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.clazz.GoodsSubClass">update yeshi_ec_sub_class set sub_name = #{name,jdbcType=VARCHAR},sub_picture = #{picture,jdbcType=VARCHAR},sub_picture_second = #{pictureSecond,jdbcType=VARCHAR},sub_weight = #{weight,jdbcType=INTEGER},sub_root_id = #{rootClass.id,jdbcType=BIGINT},sub_pid = #{parent.id,jdbcType=BIGINT},sub_level = #{level,jdbcType=INTEGER},sub_state = #{state,jdbcType=INTEGER}, sub_key = #{key,jdbcType=VARCHAR},sub_search_json = #{searchJson,jdbcType=VARCHAR},sub_ios_click = #{iosClick,jdbcType=BIGINT},sub_android_click = #{androidClick,jdbcType=BIGINT},sub_createtime = #{createtime,jdbcType=TIMESTAMP},sub_updatetime = #{updatetime,jdbcType=TIMESTAMP} where sub_id = #{id,jdbcType=BIGINT}</update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">update yeshi_ec_sub_class
-    <set>
-      <if test="name != null">sub_name=#{name,jdbcType=VARCHAR},</if>
-      <if test="picture != null">sub_picture=#{picture,jdbcType=VARCHAR},</if>
-      <if test="pictureSecond != null">sub_picture_second=#{pictureSecond,jdbcType=VARCHAR},</if>
-      <if test="weight != null">sub_weight=#{weight,jdbcType=INTEGER},</if>
-      <if test="rootClass != null">sub_root_id=#{rootClass.id,jdbcType=BIGINT},</if>
-      <if test="parent != null">sub_pid=#{parent.id,jdbcType=BIGINT},</if>
-      <if test="level != null">sub_level=#{level,jdbcType=INTEGER},</if>
-      <if test="level != null">sub_state=#{state,jdbcType=INTEGER},</if>
-      <if test="key != null">sub_key=#{key,jdbcType=VARCHAR},</if>
-      <if test="searchJson != null">sub_search_json=#{searchJson,jdbcType=VARCHAR},</if>
-      <if test="iosClick != null">sub_ios_click=#{iosClick,jdbcType=BIGINT},</if>
-      <if test="androidClick != null">sub_android_click=#{androidClick,jdbcType=BIGINT},</if>
-      <if test="createtime != null">sub_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
-      <if test="updatetime != null">sub_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
-    </set> where sub_id = #{id,jdbcType=BIGINT}
-  </update>
-  
-   <select id="queryByRootId" resultMap="BaseResultMap">
-  	<!-- 鏉′欢浜岀骇绫诲埆 -->
-    SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_sub_class 
-    	WHERE sub_root_id = #{rootId} 
-    	<if test="state != null">
-    		AND sub_state = #{state}
-    	</if>
-    	ORDER BY sub_weight,sub_updatetime
-   </select>
-   
-   <select id="queryByPid" resultMap="BaseResultMap">
-  	<!-- 鏉′欢浜岀骇绫诲埆 -->
-    SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_sub_class 
-    	WHERE sub_pid = #{pid}
-    	<if test="state != null">
-    		and sub_state = #{state}
-    	</if>
-    	ORDER BY sub_weight,sub_updatetime
-   </select>
-   
-    <select id="queryByRootIdAndWeight" resultMap="BaseResultMap">
-    	SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_sub_class 
-    	WHERE  sub_root_id = ${rootId} 
-    	<if test="type == -1">
-    		<![CDATA[and sub_weight < #{weight} ]]>  
-    		order by sub_weight desc
-    	</if>
-    	
-    	<if test="type == 1">
-    		<![CDATA[and sub_weight > #{weight} ]]>  
-    		order by sub_weight 
-    	</if>
-    	
-   </select>
-   
-    <select id="queryByPidAndWeight" resultMap="BaseResultMap">
-  		SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_sub_class 
-    	WHERE sub_pid = ${pid} 
-
-		<if test="type == -1">
-    		<![CDATA[and sub_weight < #{weight} ]]>  
-    		order by sub_weight desc
-    	</if>
-    	
-    	<if test="type == 1">
-    		<![CDATA[and sub_weight > #{weight} ]]>  
-    		order by sub_weight 
-    	</if>
-   </select>
-  
-   <select id="countByRootId" resultType="java.lang.Integer">
-  	<!-- 鏉′欢浜岀骇绫诲埆 -->
-    SELECT  count(sub_id)  FROM yeshi_ec_sub_class 
-    	WHERE sub_root_id = ${rootId}
-   </select>
-   
-   <select id="countByPid" resultType="java.lang.Integer">
-  	<!-- 鏉′欢浜岀骇绫诲埆 -->
-    SELECT  count(sub_id)  FROM yeshi_ec_sub_class 
-    	WHERE sub_pid = ${pid} 
-   </select>
-   
-   
-    <select id="getMaxWeightByRootId" resultType="java.lang.Integer">
-  	<!-- 鏉′欢浜岀骇绫诲埆 -->
-    	SELECT IFNULL(MAX(c.`sub_weight`),0) FROM `yeshi_ec_sub_class` c WHERE c.`sub_root_id` = ${rootId}
-   </select>
-   
-   <select id="getMaxWeightByPid" resultType="java.lang.Integer">
-  	<!-- 鏉′欢浜岀骇绫诲埆 -->
-    	SELECT IFNULL(MAX(c.`sub_weight`),0) FROM `yeshi_ec_sub_class` c WHERE c.`sub_root_id` = ${rootId}
-   </select>
-  
-   <select id="queryByListCid" resultMap="SimpleResultMap">
-	   SELECT * FROM yeshi_ec_sub_class
-	   WHERE sub_state = 1 AND sub_root_id in
-			<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-				${item}
-			</foreach>
-	  ORDER BY sub_weight
-   </select>
-  
+	<resultMap id="BaseResultMap"
+		type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
+		<id column="sub_id" property="id" jdbcType="BIGINT" />
+		<result column="sub_name" property="name" jdbcType="VARCHAR" />
+		<result column="sub_picture" property="picture" jdbcType="VARCHAR" />
+		<result column="sub_picture_second" property="pictureSecond"
+			jdbcType="VARCHAR" />
+		<result column="sub_weight" property="weight" jdbcType="INTEGER" />
+		<result column="sub_level" property="level" jdbcType="INTEGER" />
+		<result column="sub_state" property="state" jdbcType="INTEGER" />
+		<result column="sub_key" property="key" jdbcType="VARCHAR" />
+		<result column="sub_search_json" property="searchJson"
+			jdbcType="VARCHAR" />
+		<result column="sub_ios_click" property="iosClick" jdbcType="BIGINT" />
+		<result column="sub_android_click" property="androidClick"
+			jdbcType="BIGINT" />
+		<result column="sub_createtime" property="createtime" jdbcType="TIMESTAMP" />
+		<result column="sub_updatetime" property="updatetime" jdbcType="TIMESTAMP" />
+		<association property="rootClass" column="sub_root_id"
+			select="com.yeshi.fanli.dao.mybatis.GoodsClassMapper.selectByPrimaryKey" />
+		<association property="parent" column="sub_pid"
+			select="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.selectByPrimaryKey" />
+	</resultMap>
+	<resultMap id="SimpleResultMap"
+		type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
+		<id column="sub_id" property="id" jdbcType="BIGINT" />
+		<result column="sub_name" property="name" jdbcType="VARCHAR" />
+		<result column="sub_picture" property="picture" jdbcType="VARCHAR" />
+		<result column="sub_picture_second" property="pictureSecond"
+			jdbcType="VARCHAR" />
+		<result column="sub_weight" property="weight" jdbcType="INTEGER" />
+		<result column="sub_level" property="level" jdbcType="INTEGER" />
+		<result column="sub_state" property="state" jdbcType="INTEGER" />
+		<result column="sub_key" property="key" jdbcType="VARCHAR" />
+		<result column="sub_search_json" property="searchJson"
+			jdbcType="VARCHAR" />
+		<result column="sub_ios_click" property="iosClick" jdbcType="BIGINT" />
+		<result column="sub_android_click" property="androidClick"
+			jdbcType="BIGINT" />
+		<result column="sub_createtime" property="createtime" jdbcType="TIMESTAMP" />
+		<result column="sub_updatetime" property="updatetime" jdbcType="TIMESTAMP" />
+		<association property="rootClass" column="sub_root_id"
+			javaType="com.yeshi.fanli.entity.bus.clazz.GoodsClass">
+			<id column="sub_root_id" property="id" jdbcType="BIGINT" />
+		</association>
+		<association property="parent" column="sub_pid"
+			javaType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
+			<id column="sub_pid" property="id" jdbcType="BIGINT" />
+		</association>
+	</resultMap>
+	<sql id="Base_Column_List">sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime
+	</sql>
+	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
+		parameterType="java.lang.Long">
+		select
+		<include refid="Base_Column_List" />
+		from yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}
+	</select>
+	<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
+		yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}</delete>
+	<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass"
+		useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_sub_class
+		(sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime,sub_id)
+		values
+		(#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{pictureSecond,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{rootClass.id,jdbcType=BIGINT},#{parent.id,jdbcType=BIGINT},#{level,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{key,jdbcType=VARCHAR},#{searchJson,jdbcType=VARCHAR},#{iosClick,jdbcType=BIGINT},#{androidClick,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT})
+	</insert>
+	<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass"
+		useGeneratedKeys="true" keyProperty="id">
+		insert into yeshi_ec_sub_class
+		<trim prefix="(" suffix=")" suffixOverrides=",">
+			<if test="id != null">sub_id,</if>
+			<if test="name != null">sub_name,</if>
+			<if test="picture != null">sub_picture,</if>
+			<if test="pictureSecond != null">sub_picture_second,</if>
+			<if test="weight != null">sub_weight,</if>
+			<if test="rootClass != null">sub_root_id,</if>
+			<if test="parent != null">sub_pid,</if>
+			<if test="level != null">sub_level,</if>
+			<if test="state != null">sub_state,</if>
+			<if test="key != null">sub_key,</if>
+			<if test="searchJson != null">sub_search_json,</if>
+			<if test="iosClick != null">sub_ios_click,</if>
+			<if test="androidClick != null">sub_android_click,</if>
+			<if test="createtime != null">sub_createtime,</if>
+			<if test="updatetime != null">sub_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="pictureSecond != null">#{pictureSecond,jdbcType=VARCHAR},</if>
+			<if test="weight != null">#{weight,jdbcType=INTEGER},</if>
+			<if test="rootClass != null">#{rootClass.id,jdbcType=BIGINT},</if>
+			<if test="parent != null">#{parent.id,jdbcType=BIGINT},</if>
+			<if test="level != null">#{level,jdbcType=INTEGER},</if>
+			<if test="state != null">#{state,jdbcType=INTEGER},</if>
+			<if test="key != null">#{key,jdbcType=VARCHAR},</if>
+			<if test="searchJson != null">#{searchJson,jdbcType=VARCHAR},</if>
+			<if test="iosClick != null">#{iosClick,jdbcType=BIGINT},</if>
+			<if test="androidClick != null">#{androidClick,jdbcType=BIGINT},</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.clazz.GoodsSubClass">update
+		yeshi_ec_sub_class set sub_name = #{name,jdbcType=VARCHAR},sub_picture
+		= #{picture,jdbcType=VARCHAR},sub_picture_second =
+		#{pictureSecond,jdbcType=VARCHAR},sub_weight =
+		#{weight,jdbcType=INTEGER},sub_root_id =
+		#{rootClass.id,jdbcType=BIGINT},sub_pid =
+		#{parent.id,jdbcType=BIGINT},sub_level =
+		#{level,jdbcType=INTEGER},sub_state = #{state,jdbcType=INTEGER},
+		sub_key = #{key,jdbcType=VARCHAR},sub_search_json =
+		#{searchJson,jdbcType=VARCHAR},sub_ios_click =
+		#{iosClick,jdbcType=BIGINT},sub_android_click =
+		#{androidClick,jdbcType=BIGINT},sub_createtime =
+		#{createtime,jdbcType=TIMESTAMP},sub_updatetime =
+		#{updatetime,jdbcType=TIMESTAMP}  where sub_id = #{id,jdbcType=BIGINT}
+	</update>
+	<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
+		update yeshi_ec_sub_class
+		<set>
+			<if test="name != null">sub_name=#{name,jdbcType=VARCHAR},</if>
+			<if test="picture != null">sub_picture=#{picture,jdbcType=VARCHAR},</if>
+			<if test="pictureSecond != null">sub_picture_second=#{pictureSecond,jdbcType=VARCHAR},
+			</if>
+			<if test="weight != null">sub_weight=#{weight,jdbcType=INTEGER},</if>
+			<if test="rootClass != null">sub_root_id=#{rootClass.id,jdbcType=BIGINT},</if>
+			<if test="parent != null">sub_pid=#{parent.id,jdbcType=BIGINT},</if>
+			<if test="level != null">sub_level=#{level,jdbcType=INTEGER},</if>
+			<if test="level != null">sub_state=#{state,jdbcType=INTEGER},</if>
+			<if test="key != null">sub_key=#{key,jdbcType=VARCHAR},</if>
+			<if test="searchJson != null">sub_search_json=#{searchJson,jdbcType=VARCHAR},</if>
+			<if test="iosClick != null">sub_ios_click=#{iosClick,jdbcType=BIGINT},</if>
+			<if test="androidClick != null">sub_android_click=#{androidClick,jdbcType=BIGINT},</if>
+			<if test="createtime != null">sub_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
+			<if test="updatetime != null">sub_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
+		</set>
+		where sub_id = #{id,jdbcType=BIGINT}
+	</update>
+	<select id="queryByRootId" resultMap="BaseResultMap">
+		<!-- 鏉′欢浜岀骇绫诲埆 -->
+		SELECT
+		<include refid="Base_Column_List" />
+		FROM yeshi_ec_sub_class WHERE sub_root_id = #{rootId}
+		<if test="state != null">AND sub_state = #{state}</if>
+		ORDER BY sub_weight,sub_updatetime
+	</select>
+	<select id="queryByPid" resultMap="BaseResultMap">
+		<!-- 鏉′欢浜岀骇绫诲埆 -->
+		SELECT
+		<include refid="Base_Column_List" />
+		FROM yeshi_ec_sub_class WHERE sub_pid = #{pid}
+		<if test="state != null">and sub_state = #{state}</if>
+		ORDER BY sub_weight,sub_updatetime
+	</select>
+	<select id="queryByRootIdAndWeight" resultMap="BaseResultMap">
+		SELECT
+		<include refid="Base_Column_List" />
+		FROM yeshi_ec_sub_class WHERE sub_root_id = ${rootId}
+		<if test="type == -1"> <![CDATA[and sub_weight < #{weight} ]]>
+			order by sub_weight desc
+		</if>
+		<if test="type == 1"> <![CDATA[and sub_weight > #{weight} ]]>
+			order by sub_weight
+		</if>
+	</select>
+	<select id="queryByPidAndWeight" resultMap="BaseResultMap">
+		SELECT
+		<include refid="Base_Column_List" />
+		FROM yeshi_ec_sub_class WHERE sub_pid = ${pid}
+		<if test="type == -1"> <![CDATA[and sub_weight < #{weight} ]]>
+			order by sub_weight desc
+		</if>
+		<if test="type == 1"> <![CDATA[and sub_weight > #{weight} ]]>
+			order by sub_weight
+		</if>
+	</select>
+	<select id="countByRootId" resultType="java.lang.Integer">
+		<!-- 鏉′欢浜岀骇绫诲埆 -->
+		SELECT count(sub_id) FROM yeshi_ec_sub_class WHERE sub_root_id =
+		${rootId}
+	</select>
+	<select id="countByPid" resultType="java.lang.Integer">
+		<!-- 鏉′欢浜岀骇绫诲埆 -->
+		SELECT count(sub_id) FROM yeshi_ec_sub_class WHERE sub_pid = ${pid}
+	</select>
+	<select id="getMaxWeightByRootId" resultType="java.lang.Integer">
+		<!-- 鏉′欢浜岀骇绫诲埆 -->
+		SELECT IFNULL(MAX(c.`sub_weight`),0) FROM `yeshi_ec_sub_class` c WHERE
+		c.`sub_root_id` = ${rootId}
+	</select>
+	<select id="getMaxWeightByPid" resultType="java.lang.Integer">
+		<!-- 鏉′欢浜岀骇绫诲埆 -->
+		SELECT IFNULL(MAX(c.`sub_weight`),0) FROM `yeshi_ec_sub_class` c WHERE
+		c.`sub_root_id` = ${rootId}
+	</select>
+	<select id="queryByListCid" resultMap="SimpleResultMap">
+		SELECT * FROM yeshi_ec_sub_class WHERE sub_state = 1 AND sub_root_id
+		in
+		<foreach collection="list" index="index" item="item"
+			separator="," open="(" close=")">${item}</foreach>
+		ORDER BY sub_weight
+	</select>
 </mapper>

--
Gitblit v1.8.0