|
|
@@ -0,0 +1,136 @@
|
|
|
+<?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.dk.oauth.mapper.GoodsCategoryMapper">
|
|
|
+
|
|
|
+ <!-- 通用设置 -->
|
|
|
+ <!-- 通用查询列 -->
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ cat_id
|
|
|
+ , cat_code, cat_name, parent_id, display_no, top_id, level_upper, level_lower, level_leaf, level_no,
|
|
|
+ level_code, level_name, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time,
|
|
|
+ op_update_user_id, op_app_code, op_timestamp, op_db_user
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List_Join">
|
|
|
+ tmgc.cat_id
|
|
|
+ , tmgc.cat_code, tmgc.cat_name, tmgc.parent_id, tmgc.display_no, tmgc.top_id, tmgc.level_upper,
|
|
|
+ tmgc.level_lower, tmgc.level_leaf, tmgc.level_no, tmgc.level_code, tmgc.level_name, tmgc.remarks,
|
|
|
+ tmgc.flg_valid, tmgc.cp_id
|
|
|
+ </sql>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResultMap" type="com.dk.oauth.entity.GoodsCategory">
|
|
|
+ <id column="cat_id" property="catId"/>
|
|
|
+ <result column="cat_code" property="catCode"/>
|
|
|
+ <result column="cat_name" property="catName"/>
|
|
|
+ <result column="parent_id" property="parentId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="display_no" property="displayNo"/>
|
|
|
+ <result column="top_id" property="topId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="level_upper" property="levelUpper" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="level_lower" property="levelLower" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="level_leaf" property="levelLeaf"/>
|
|
|
+ <result column="level_no" property="levelNo"/>
|
|
|
+ <result column="level_code" property="levelCode"/>
|
|
|
+ <result column="level_name" property="levelName"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_app_code" property="opAppCode"/>
|
|
|
+ <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_db_user" property="opDbUser"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMapResponse" type="com.dk.oauth.response.GoodsCategoryResponse">
|
|
|
+ <id column="cat_id" property="catId"/>
|
|
|
+ <result column="cat_code" property="catCode"/>
|
|
|
+ <result column="cat_name" property="catName"/>
|
|
|
+ <result column="parent_id" property="parentId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="display_no" property="displayNo"/>
|
|
|
+ <result column="top_id" property="topId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="level_upper" property="levelUpper" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="level_lower" property="levelLower" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="level_leaf" property="levelLeaf"/>
|
|
|
+ <result column="level_no" property="levelNo"/>
|
|
|
+ <result column="level_code" property="levelCode"/>
|
|
|
+ <result column="level_name" property="levelName"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ <result column="parentName" property="parentName"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 通用条件列 -->
|
|
|
+ <sql id="Condition">
|
|
|
+ <where>
|
|
|
+ <if test="catCode != null and catCode != ''">
|
|
|
+ AND tmgc.cat_code LIKE concat('%',my_ex.likequery(#{catCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="catName != null and catName != ''">
|
|
|
+ AND tmgc.cat_name LIKE concat('%',my_ex.likequery(#{catName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="parentId != null and parentId != ''">
|
|
|
+ AND tmgc.parent_id = #{parentId}
|
|
|
+ </if>
|
|
|
+ <if test="displayNo != null">
|
|
|
+ AND tmgc.display_no = #{displayNo}
|
|
|
+ </if>
|
|
|
+ <if test="topId != null and topId != ''">
|
|
|
+ AND tmgc.top_id = #{topId}
|
|
|
+ </if>
|
|
|
+ <if test="levelUpper != null and levelUpper != ''">
|
|
|
+ AND tmgc.level_upper = #{levelUpper}
|
|
|
+ </if>
|
|
|
+ <if test="levelLower != null and levelLower != ''">
|
|
|
+ AND tmgc.level_lower = #{levelLower}
|
|
|
+ </if>
|
|
|
+ <if test="levelLeaf != null">
|
|
|
+ AND tmgc.level_leaf = #{levelLeaf}
|
|
|
+ </if>
|
|
|
+ <if test="levelNo != null">
|
|
|
+ AND tmgc.level_no = #{levelNo}
|
|
|
+ </if>
|
|
|
+ <if test="levelCode != null and levelCode != ''">
|
|
|
+ AND tmgc.level_code = #{levelCode}
|
|
|
+ </if>
|
|
|
+ <if test="levelName != null and levelName != ''">
|
|
|
+ AND tmgc.level_name = #{levelName}
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND tmgc.remarks = #{remarks}
|
|
|
+ </if>
|
|
|
+ <if test="flgValid != null">
|
|
|
+ AND tmgc.flg_valid = #{flgValid}
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND tmgc.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+ <if test="flgValidList != null and flgValidList.size()>0">
|
|
|
+ AND tmgc.flg_valid =
|
|
|
+ any(#{flgValidList, typeHandler=BooleanListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="searchText != null">
|
|
|
+ AND (tmgc.cat_code like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ OR tmgc.cat_name like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ OR tmgc.remarks like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 查询表t_mst_goods_category,(条件查询+分页)列表 -->
|
|
|
+ <select id="selectByCond" resultMap="BaseResultMapResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Join"/>
|
|
|
+ FROM dkic_b.t_mst_goods_category tmgc
|
|
|
+ where tmgc.flg_valid
|
|
|
+ ORDER BY tmgc.display_no
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|