|
|
@@ -630,7 +630,7 @@
|
|
|
select sku_id as "skuId",
|
|
|
sku_code as "skuCode",
|
|
|
sku_name as "skuName",
|
|
|
- remarks as "remarks"
|
|
|
+ remarks as "remarks"
|
|
|
from mst.t_erp_sku
|
|
|
where flg_valid
|
|
|
and fty_id = #{ftyId}
|
|
|
@@ -2577,36 +2577,6 @@
|
|
|
and ptwp.flg_valid
|
|
|
</select>
|
|
|
|
|
|
- <!--获取仓库-->
|
|
|
- <select id="getWarehouseByPage" resultType="java.util.Map">
|
|
|
- SELECT mtw.wh_id as "whId",sys.f_code_name(mtw.wh_code,mtw.wh_name) AS "whCodeName"
|
|
|
- FROM mst.t_warehouse mtw left join core.t_user ctu on ctu.user_id = mtw.op_create_user_id
|
|
|
- WHERE mtw.fty_id = #{ftyId}
|
|
|
- and mtw.flg_valid
|
|
|
- <if test="whCode!=null and whCode!=''">
|
|
|
- and position(#{whCode} in mtw.wh_code) > 0
|
|
|
- </if>
|
|
|
- <if test="whName!=null and whName!=''">
|
|
|
- and position(#{warehouseName} in mtw.wh_name) > 0
|
|
|
- </if>
|
|
|
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
- limit #{end} offset #{start}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
- <!--获取仓库个数-->
|
|
|
- <select id="countWarehouseByPage" resultType="Long">
|
|
|
- select count(1)
|
|
|
- from mst.t_warehouse mtw
|
|
|
- WHERE mtw.fty_id = #{ftyId}
|
|
|
- and mtw.flg_valid
|
|
|
- <if test="whCode!=null and whCode!=''">
|
|
|
- and position(#{whCode} in mtw.wh_code) > 0
|
|
|
- </if>
|
|
|
- <if test="whName!=null and whName!=''">
|
|
|
- and position(#{warehouseName} in mtw.wh_name) > 0
|
|
|
- </if>
|
|
|
- </select>
|
|
|
|
|
|
<!--获取仓位-->
|
|
|
<select id="getWarehousePlaceByPage" resultType="java.util.Map">
|
|
|
@@ -2805,7 +2775,6 @@
|
|
|
left join dkic_b.t_mst_goods_series as tmgseries on tmgs.series_id = tmgseries.series_id
|
|
|
left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
|
|
|
where tmgs.flg_valid
|
|
|
- and tmgs.cp_id = #{cpId}
|
|
|
<if test="skuCode != null">
|
|
|
AND tmgs.sku_code = #{skuCode}
|
|
|
</if>
|
|
|
@@ -2820,7 +2789,6 @@
|
|
|
count(1)
|
|
|
from dkic_b.t_mst_goods_sku as tmgs
|
|
|
where tmgs.flg_valid
|
|
|
- and tmgs.cp_id = #{cpId}
|
|
|
<if test="skuCode != null">
|
|
|
AND tmgs.sku_code = #{skuCode}
|
|
|
</if>
|
|
|
@@ -2867,7 +2835,6 @@
|
|
|
inner join dkic_b.t_mst_sale_channel tmsc on tmc.channel_id = tmsc.channel_id
|
|
|
left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
|
|
|
where tmc.flg_valid
|
|
|
- and tmc.cp_id = #{cpId}
|
|
|
<if test="skuCode != null">
|
|
|
AND tmc.cus_code = #{cusCode}
|
|
|
</if>
|
|
|
@@ -2964,4 +2931,187 @@
|
|
|
limit #{limit}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <select id="getGoodsBrand" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ tmgb.flg_valid AS "flgValid",
|
|
|
+ tmgb.brand_id AS "brandId", tmgb.brand_code AS "brandCode", tmgb.brand_name AS "brandName",
|
|
|
+ (SELECT COALESCE(array_to_string(array_agg(tsm.sup_name), ','),'')
|
|
|
+ FROM dkic_b.t_mst_supplier_brand tsmb
|
|
|
+ left join dkic_b.t_mst_supplier tsm on tsm.sup_id = tsmb.sup_id
|
|
|
+ WHERE tsmb.brand_id = tmgb.brand_id) AS "supplierName"
|
|
|
+ FROM dkic_b.t_mst_goods_brand tmgb
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( tmgb.brand_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by display_no asc
|
|
|
+ <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
|
|
|
+ count(1)
|
|
|
+ FROM dkic_b.t_mst_goods_brand tmgb
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( tmgb.brand_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="getGoodsCategory" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ cat_code AS "catCode",
|
|
|
+ cat_name AS "catName",
|
|
|
+ flg_valid AS "flgValid"
|
|
|
+ FROM dkic_b.t_mst_goods_category
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( cat_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or ( remarks LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY display_no
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="countGoodsCategory" resultType="java.lang.Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM dkic_b.t_mst_goods_category
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( cat_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or ( remarks LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="getGoodsSeries" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ series_code AS "catCode",
|
|
|
+ series_name AS "catName",
|
|
|
+ flg_valid AS "flgValid"
|
|
|
+ FROM dkic_b.t_mst_goods_series
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( series_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or ( remarks LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by display_no asc
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="countGoodsSeries" resultType="java.lang.Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM dkic_b.t_mst_goods_series
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( series_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or ( remarks LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="getUnit" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ unit_code AS "unitCode",
|
|
|
+ unit_name AS "unitName",
|
|
|
+ flg_valid AS "flgValid"
|
|
|
+ FROM dkic_b.t_mst_unit
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( unit_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or ( remarks LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by display_no asc
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="countUnit" resultType="java.lang.Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM dkic_b.t_mst_unit
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( unit_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or ( remarks LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--获取仓库档案-->
|
|
|
+ <select id="getWarehouseByPage" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ wh_code AS "whCode",
|
|
|
+ wh_name AS "whName",
|
|
|
+ supervisor AS "supervisor",
|
|
|
+ contact_phone AS "contactPhone",
|
|
|
+ flg_valid AS "flgValid"
|
|
|
+ FROM dkic_b.t_mst_warehouse
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( wh_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or ( remarks LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by display_no asc
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--获取仓库档案个数-->
|
|
|
+ <select id="countWarehouseByPage" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM dkic_b.t_mst_warehouse
|
|
|
+ <where>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( wh_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or ( remarks LIKE concat('%', #{searchText}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|