|
|
@@ -703,6 +703,67 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 查询商品种类-->
|
|
|
+ <select id="getGoodsCategoryTree" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ T.cat_id AS "catId",
|
|
|
+ T.cat_code AS "catCode",
|
|
|
+ T.cat_name AS "catName",
|
|
|
+ T.parent_id AS "parentId",
|
|
|
+ T.flg_valid AS "flgValid"
|
|
|
+ FROM
|
|
|
+ (--当前数据
|
|
|
+ SELECT
|
|
|
+ tmgc.cat_id,
|
|
|
+ tmgc.cat_code,
|
|
|
+ tmgc.cat_name,
|
|
|
+ tmgc.parent_id,
|
|
|
+ tmgc.flg_valid
|
|
|
+ FROM
|
|
|
+ dkic_b.t_mst_goods_category tmgc
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( tmgc.cat_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
|
|
|
+ or tmgc.remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND tmgc.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ UNION ALL--父级
|
|
|
+ SELECT
|
|
|
+ tmgcp.cat_id,
|
|
|
+ tmgcp.cat_code,
|
|
|
+ tmgcp.cat_name,
|
|
|
+ tmgcp.parent_id,
|
|
|
+ tmgcp.flg_valid
|
|
|
+ FROM
|
|
|
+ dkic_b.t_mst_goods_category tmgc
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_category tmgcp ON tmgc.cat_id = ANY ( tmgcp.level_lower )
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( tmgc.cat_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
|
|
|
+ or tmgc.remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND tmgc.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) T
|
|
|
+ WHERE T.cat_id IS NOT NULL
|
|
|
+ GROUP BY
|
|
|
+ T.cat_id,
|
|
|
+ T.cat_code,
|
|
|
+ T.cat_name,
|
|
|
+ T.parent_id,
|
|
|
+ T.flg_valid
|
|
|
+
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 查询表t_mst_goods_brand,(条件查询)个数 -->
|
|
|
<select id="countGoodsBrand" resultType="Long">
|
|
|
SELECT
|