From 261609854ff8c912d70b12809153f1efc28e76ce Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 11 三月 2019 17:21:07 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml | 42 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 38 insertions(+), 4 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 12727e5..461a973 100644 --- a/fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml +++ b/fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml @@ -25,6 +25,32 @@ </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_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_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} @@ -89,9 +115,8 @@ SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_sub_class WHERE sub_root_id = #{rootId} <if test="state != null"> - and sub_state = #{state} + AND sub_state = #{state} </if> - ORDER BY sub_weight,sub_updatetime </select> @@ -138,13 +163,13 @@ <select id="countByRootId" resultType="java.lang.Integer"> <!-- 鏉′欢浜岀骇绫诲埆 --> SELECT count(sub_id) FROM yeshi_ec_sub_class - WHERE sub_root_id = ${rootId} ORDER BY sub_weight + 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} ORDER BY sub_weight + WHERE sub_pid = ${pid} </select> @@ -158,4 +183,13 @@ 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_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