|
|
@@ -17,6 +17,8 @@
|
|
|
<result column="layer" jdbcType="INTEGER" property="layer" />
|
|
|
<result column="sort" jdbcType="INTEGER" property="sort" />
|
|
|
<result column="module" jdbcType="INTEGER" property="module" />
|
|
|
+ <result column="pc_index" jdbcType="INTEGER" property="pcIndex" />
|
|
|
+ <result column="app_index" jdbcType="INTEGER" property="appIndex" />
|
|
|
</resultMap>
|
|
|
<sql id="Example_Where_Clause">
|
|
|
<!--
|
|
|
@@ -92,7 +94,7 @@
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Tue Jul 17 09:14:43 CST 2018.
|
|
|
-->
|
|
|
- id, name, summary, number, create_time, super_id, img_url, layer, sort, module
|
|
|
+ id, name, summary, number, create_time, super_id, img_url, layer, sort, module, pc_index, app_index
|
|
|
</sql>
|
|
|
<select id="selectByExample" parameterType="com.goafanti.common.model.JtBusinessCategoryExample" resultMap="BaseResultMap">
|
|
|
<!--
|
|
|
@@ -153,11 +155,11 @@
|
|
|
insert into jt_business_category (id, name, summary,
|
|
|
number, create_time, super_id,
|
|
|
img_url, layer, sort,
|
|
|
- module)
|
|
|
+ module, pc_index, app_index)
|
|
|
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{summary,jdbcType=VARCHAR},
|
|
|
#{number,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{superId,jdbcType=VARCHAR},
|
|
|
#{imgUrl,jdbcType=VARCHAR}, #{layer,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
|
|
|
- #{module,jdbcType=INTEGER})
|
|
|
+ #{module,jdbcType=INTEGER}, #{pcIndex,jdbcType=INTEGER}, #{appIndex,jdbcType=INTEGER})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.JtBusinessCategory">
|
|
|
<!--
|
|
|
@@ -197,6 +199,12 @@
|
|
|
<if test="module != null">
|
|
|
module,
|
|
|
</if>
|
|
|
+ <if test="pcIndex != null">
|
|
|
+ pc_index,
|
|
|
+ </if>
|
|
|
+ <if test="appIndex != null">
|
|
|
+ app_index,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">
|
|
|
@@ -229,6 +237,12 @@
|
|
|
<if test="module != null">
|
|
|
#{module,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="pcIndex != null">
|
|
|
+ #{pcIndex,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="appIndex != null">
|
|
|
+ #{appIndex,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<select id="countByExample" parameterType="com.goafanti.common.model.JtBusinessCategoryExample" resultType="java.lang.Long">
|
|
|
@@ -280,6 +294,12 @@
|
|
|
<if test="record.module != null">
|
|
|
module = #{record.module,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="record.pcIndex != null">
|
|
|
+ pc_index = #{record.pcIndex,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.appIndex != null">
|
|
|
+ app_index = #{record.appIndex,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
<if test="_parameter != null">
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
@@ -301,7 +321,9 @@
|
|
|
img_url = #{record.imgUrl,jdbcType=VARCHAR},
|
|
|
layer = #{record.layer,jdbcType=INTEGER},
|
|
|
sort = #{record.sort,jdbcType=INTEGER},
|
|
|
- module = #{record.module,jdbcType=INTEGER}
|
|
|
+ module = #{record.module,jdbcType=INTEGER},
|
|
|
+ pc_index = #{record.pcIndex,jdbcType=INTEGER},
|
|
|
+ app_index = #{record.appIndex,jdbcType=INTEGER}
|
|
|
<if test="_parameter != null">
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
</if>
|
|
|
@@ -341,6 +363,12 @@
|
|
|
<if test="module != null">
|
|
|
module = #{module,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="pcIndex != null">
|
|
|
+ pc_index = #{pcIndex,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="appIndex != null">
|
|
|
+ app_index = #{appIndex,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -359,7 +387,9 @@
|
|
|
img_url = #{imgUrl,jdbcType=VARCHAR},
|
|
|
layer = #{layer,jdbcType=INTEGER},
|
|
|
sort = #{sort,jdbcType=INTEGER},
|
|
|
- module = #{module,jdbcType=INTEGER}
|
|
|
+ module = #{module,jdbcType=INTEGER},
|
|
|
+ pc_index = #{pcIndex,jdbcType=INTEGER},
|
|
|
+ app_index = #{appIndex,jdbcType=INTEGER}
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
|
|
|
@@ -454,7 +484,7 @@ and layer=#{0}
|
|
|
</update>
|
|
|
|
|
|
<select id="getCategoryListByCondition" resultType="com.goafanti.common.model.JtBusinessCategoryResult">
|
|
|
- select bc1.id,bc1.sort,bc1.number,bc1.name,bc1.super_id as superId,bc1.layer,bc2.name as superName,bc1.module as module
|
|
|
+ select bc1.id,bc1.sort,bc1.number,bc1.name,bc1.super_id as superId,bc1.layer,bc2.name as superName,bc1.module as module, bc1.app_index, bc1.pc_index
|
|
|
from jt_business_category bc1
|
|
|
left join jt_business_category bc2 on bc2.id=bc1.super_id
|
|
|
where
|
|
|
@@ -534,4 +564,47 @@ and layer=#{0}
|
|
|
limit 1
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 根据名称获得自己的子分类 -->
|
|
|
+ <select id="getCategoryByName" parameterType="com.goafanti.common.model.JtBusinessCategory" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ c2.id, c2.name, c2.summary, c2.number, c2.create_time, c2.super_id,
|
|
|
+ c2.img_url, c2.layer, c2.sort, c2.module
|
|
|
+ from jt_business_category c1
|
|
|
+ inner join jt_business_category c2 on c1.id = c2.super_id
|
|
|
+ where 1=1
|
|
|
+ <if test="name != null">
|
|
|
+ and c1.name = #{name,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="pcIndex != null">
|
|
|
+ and c2.pc_index = #{pcIndex,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="appIndex != null">
|
|
|
+ and c2.app_index = #{appIndex,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ order by sort
|
|
|
+ <if test="number != null">
|
|
|
+ limit #{layer,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!-- 根据模块获得指定的层级的分类 -->
|
|
|
+ <select id="getCategoryByModel" parameterType="com.goafanti.common.model.JtBusinessCategory" resultMap="BaseResultMap">
|
|
|
+ select * from jt_business_category
|
|
|
+ where 1 = 1
|
|
|
+ <if test="module != null">
|
|
|
+ and module = #{module,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="layer != null">
|
|
|
+ and layer = #{layer,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="pcIndex != null">
|
|
|
+ and pc_index = #{pcIndex,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="appIndex != null">
|
|
|
+ and app_index = #{appIndex,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ order by sort
|
|
|
+ <if test="number != null">
|
|
|
+ limit #{sort,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|