于继渤 2 lat temu
rodzic
commit
a99acc3a4c

+ 1 - 13
src/main/java/com/dk/mdm/controller/common/CommonController.java

@@ -550,19 +550,7 @@ public class CommonController extends BaseController<Map<String, Object>> {
         return commonService.getServiceCategories(param);
     }
 
-    /**
-     * @desc : 获取仓库
-     * @author : 王英杰
-     * @date : 2024/2/26 10:36
-     */
-    @ApiOperation(
-            value = "获取账户类别",
-            notes = "获取账户类别"
-    )
-    @PostMapping("get_dictionarydata_by_page")
-    public ResponseResultVO<PageList<Map<String, Object>>> getDictionaryDataByPage(@RequestBody Map<String, Object> param) {
-        return commonService.getDictionaryDataByPage(param);
-    }
+
 
 
 

+ 1 - 20
src/main/java/com/dk/mdm/mapper/common/CommonMapper.java

@@ -352,7 +352,7 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
 
     /**
      * @desc : 获取获取仓库档案个数
-     * @author : 洪旭东
+     * @author : 王英杰
      * @date : 2024/3/1 9:21
      */
     Long countWarehouseByPage(Map param);
@@ -393,26 +393,7 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
     List<Map<String, Object>> getServiceCategories(Map param);
 
 
-    /**
-     * @desc : 获取账户类别
-     * @author : 王英杰
-     * @date : 2024/3/1 9:21
-     */
-    List<Map<String, Object>> getDictionaryDataByPage(Map param);
 
-    /**
-     * @desc : 获取账户类别个数
-     * @author : 洪旭东
-     * @date : 2024/3/1 9:21
-     */
-    Long countDictionaryDataByPage(Map param);
-    /**
-     * @desc : 客户来源
-     * @author : 于继渤
-     * @date : 2024/3/1 9:21
-     */
     List<Map<String, Object>> getSaleChannel(Map param);
-
     List<Map<String, Object>> getStaff(Map param);
-
 }

+ 200 - 237
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -114,16 +114,16 @@
     <!-- 获取组织部门 -->
     <select id="getOrg" resultType="java.util.Map">
         select org_Id     AS "orgId",
-               org_code   AS "orgCode",
-               org_name   AS "orgName",
-               org_Id     AS "id",
-               parent_id  AS "parentId",
-               top_Id     AS "topId",
-               display_no AS "displayNo",
-               remarks
+        org_code   AS "orgCode",
+        org_name   AS "orgName",
+        org_Id     AS "id",
+        parent_id  AS "parentId",
+        top_Id     AS "topId",
+        display_no AS "displayNo",
+        remarks
         from dkic_b.t_mst_org
         where flg_valid
-          and cp_id = #{cpId}
+        and cp_id = #{cpId}
         <if test="topId != null">
             AND top_id = #{topId}
         </if>
@@ -145,7 +145,7 @@
         count(1)
         from dkic_b.t_mst_org
         where flg_valid
-          and cp_id = #{cpId}
+        and cp_id = #{cpId}
         <if test="topId != null">
             AND top_id = #{topId}
         </if>
@@ -163,27 +163,27 @@
     <!-- 获取用户菜单-->
     <select id="getMenuByUser" resultType="java.util.Map">
         select menu_uuid      AS "menuUuid",
-               name           AS "name",
-               menu_name      AS "menuName",
-               parent_uuid    AS "parentUuid",
-               menu_type      AS "menuType",
-               flg_menu       AS "flgMenu",
-               flg_right      AS "flgRight",
-               object_code    AS "objectCode",
-               object_paths   AS "objectPaths",
-               object_icon    AS "icon",
-               parent_path    AS "parentPath",
-               menu_tags      AS "menuTags",
-               level_code     AS "levelCode",
-               flg_fast       AS "flgFast",
-               fast_image     AS "fastImage",
-               fast_path      AS "fastPath",
-               ex_menu_uuid   AS "exMenuUuid",
-               flg_same_route AS "flgSameRoute",
-               flg_choose_id  AS "flgChooseId",
-               #{appCode}     AS "appCode",
-               menu_uuid      AS "id",
-               parent_uuid    AS "parentId"
+        name           AS "name",
+        menu_name      AS "menuName",
+        parent_uuid    AS "parentUuid",
+        menu_type      AS "menuType",
+        flg_menu       AS "flgMenu",
+        flg_right      AS "flgRight",
+        object_code    AS "objectCode",
+        object_paths   AS "objectPaths",
+        object_icon    AS "icon",
+        parent_path    AS "parentPath",
+        menu_tags      AS "menuTags",
+        level_code     AS "levelCode",
+        flg_fast       AS "flgFast",
+        fast_image     AS "fastImage",
+        fast_path      AS "fastPath",
+        ex_menu_uuid   AS "exMenuUuid",
+        flg_same_route AS "flgSameRoute",
+        flg_choose_id  AS "flgChooseId",
+        #{appCode}     AS "appCode",
+        menu_uuid      AS "id",
+        parent_uuid    AS "parentId"
         from
         <if test="appCode=='WEB-TOUCH'">
             core.f_get_user_menu_touch(#{appCode}, #{userId})
@@ -208,13 +208,13 @@
     <!-- 获取员工 -->
     <select id="getStaffByPage" resultType="java.util.Map">
         select staff.staff_id                                      AS "staffId",
-               staff.staff_code                                    AS "staffCode",
-               staff.staff_name                                    AS "staffName",
-               sys.f_code_name(staff.staff_code, staff.staff_name) AS "staffCodeName",
-               staff.remarks
+        staff.staff_code                                    AS "staffCode",
+        staff.staff_name                                    AS "staffName",
+        sys.f_code_name(staff.staff_code, staff.staff_name) AS "staffCodeName",
+        staff.remarks
         from dkic_b.t_mst_staff AS staff
         where staff.flg_valid
-          and staff.cp_id =#{cpId}
+        and staff.cp_id =#{cpId}
         <if test="staffCode != null and staffCode != ''">
             And position (#{staffCode} in staff.staff_code)>0
         </if>
@@ -233,7 +233,7 @@
         count(1)
         from dkic_b.t_mst_staff AS staff
         where staff.flg_valid
-          and staff.cp_id =#{cpId}
+        and staff.cp_id =#{cpId}
         <if test="staffCode != null and staffCode != ''">
             And position (#{staffCode} in staff.staff_code)>0
         </if>
@@ -295,9 +295,9 @@
     <!-- 获取仓库 -->
     <select id="getWarehouse" resultType="java.util.Map">
         SELECT tmw.wh_id as "whId"
-                ,tmw.wh_name as "whName"
-                ,tmw.wh_code as "whCode"
-                ,tmw.flg_default as "flgDefault"
+        ,tmw.wh_name as "whName"
+        ,tmw.wh_code as "whCode"
+        ,tmw.flg_default as "flgDefault"
         FROM dkic_b.t_mst_warehouse tmw
         WHERE tmw.cp_id = #{cpId}
         and tmw.flg_valid
@@ -315,33 +315,33 @@
     <!-- 获取商品 -->
     <select id="getGoods" resultType="java.util.Map">
         select tmgs.sku_id            as "skuId",
-               tmgs.sku_code          as "skuCode",
-               tmgs.sku_name          as "skuName",
-               tmgs.sku_model         as "skuModel",
-               tmgs.brand_id          as "brandId",
-               tmgb.brand_name        as "brandName",
-               tmgs.category_id       as "categoryId",
-               tmgc.cat_name          as "categoryName",
-               tmgs.unit_id           as "unitId",
-               tmgu.unit_name         as "unitName",
-               tmgs.sub_unit_id       as "subUnitId",
-               tmgs.conversion_factor as "conversionFactor",
-               tmgs.series_id         as "seriesId",
-               tmgseries.series_name  as "seriesName",
-               tmgs.sku_spec          as "skuSpec",
-               tmgs.price_purchase    as "pricePurchase",
-               tmgs.price_standard    as "priceStandard",
-               tmgs.price_wholesale   as "priceWholesale",
-               tmgs.price_limited     as "priceLimited",
-               tmgs.sku_images        as "skuImages",
-               tmgs.remarks
+        tmgs.sku_code          as "skuCode",
+        tmgs.sku_name          as "skuName",
+        tmgs.sku_model         as "skuModel",
+        tmgs.brand_id          as "brandId",
+        tmgb.brand_name        as "brandName",
+        tmgs.category_id       as "categoryId",
+        tmgc.cat_name          as "categoryName",
+        tmgs.unit_id           as "unitId",
+        tmgu.unit_name         as "unitName",
+        tmgs.sub_unit_id       as "subUnitId",
+        tmgs.conversion_factor as "conversionFactor",
+        tmgs.series_id         as "seriesId",
+        tmgseries.series_name  as "seriesName",
+        tmgs.sku_spec          as "skuSpec",
+        tmgs.price_purchase    as "pricePurchase",
+        tmgs.price_standard    as "priceStandard",
+        tmgs.price_wholesale   as "priceWholesale",
+        tmgs.price_limited     as "priceLimited",
+        tmgs.sku_images        as "skuImages",
+        tmgs.remarks
         from dkic_b.t_mst_goods_sku as tmgs
-                 left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
-                 left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
-                 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
+        left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
+        left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
+        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}
+        AND tmgs.cp_id = #{cpId}
         <if test="skuCode != null">
             AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
         </if>
@@ -356,7 +356,7 @@
         count(1)
         from dkic_b.t_mst_goods_sku as tmgs
         where tmgs.flg_valid
-          AND tmgs.cp_id = #{cpId}
+        AND tmgs.cp_id = #{cpId}
         <if test="skuCode != null">
             AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
         </if>
@@ -368,33 +368,33 @@
     <!-- 获取商品 -->
     <select id="getGoodsForOrder" resultType="java.util.Map">
         select tmgs.sku_id            as "skuId",
-               tmgs.sku_code          as "skuCode",
-               tmgs.sku_name          as "skuName",
-               tmgs.sku_model         as "skuModel",
-               tmgs.brand_id          as "brandId",
-               tmgb.brand_name        as "brandName",
-               tmgs.category_id       as "categoryId",
-               tmgc.cat_name          as "categoryName",
-               tmgs.unit_id           as "unitId",
-               tmgu.unit_name         as "unitName",
-               tmgs.sub_unit_id       as "subUnitId",
-               tmgs.conversion_factor as "conversionFactor",
-               tmgs.series_id         as "seriesId",
-               tmgseries.series_name  as "seriesName",
-               tmgs.sku_spec          as "skuSpec",
-               tmgs.price_purchase    as "pricePurchase",
-               tmgs.price_standard    as "priceStandard",
-               tmgs.price_wholesale   as "priceWholesale",
-               tmgs.price_limited     as "priceLimited",
-               tmgs.sku_images        as "skuImages",
-               tmgs.remarks
+        tmgs.sku_code          as "skuCode",
+        tmgs.sku_name          as "skuName",
+        tmgs.sku_model         as "skuModel",
+        tmgs.brand_id          as "brandId",
+        tmgb.brand_name        as "brandName",
+        tmgs.category_id       as "categoryId",
+        tmgc.cat_name          as "categoryName",
+        tmgs.unit_id           as "unitId",
+        tmgu.unit_name         as "unitName",
+        tmgs.sub_unit_id       as "subUnitId",
+        tmgs.conversion_factor as "conversionFactor",
+        tmgs.series_id         as "seriesId",
+        tmgseries.series_name  as "seriesName",
+        tmgs.sku_spec          as "skuSpec",
+        tmgs.price_purchase    as "pricePurchase",
+        tmgs.price_standard    as "priceStandard",
+        tmgs.price_wholesale   as "priceWholesale",
+        tmgs.price_limited     as "priceLimited",
+        tmgs.sku_images        as "skuImages",
+        tmgs.remarks
         from dkic_b.t_mst_goods_sku as tmgs
-                 left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
-                 left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
-                 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
+        left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
+        left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
+        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}
+        AND tmgs.cp_id = #{cpId}
         <if test="skuCode != null">
             AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
         </if>
@@ -409,7 +409,7 @@
         count(1)
         from dkic_b.t_mst_goods_sku as tmgs
         where tmgs.flg_valid
-          AND tmgs.cp_id = #{cpId}
+        AND tmgs.cp_id = #{cpId}
         <if test="skuCode != null">
             AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
         </if>
@@ -474,42 +474,42 @@
     <!-- 获取客户 -->
     <select id="getCustomer" resultType="java.util.Map">
         select tmc.cus_id             as "cusId",
-               tmc.cus_code           as "cusCode",
-               tmc.cus_name           as "cusName",
-               tmc.cus_phone          as "cusPhone",
-               tmc.address_area       as "addressArea",
-               tmc.address_name       as "addressName",
-               tmc.address_no         as "addressNo",
-               tmc.address_gcj02      as "addressGcj02",
-               tmc.address_full       as "addressFull",
-               tmc.contact_name       as "contactName",
-               tmc.contact_phone      as "contactPhone",
-               tmc.cus_from           as "cusFrom",
-               tmdd.data_value        as "cusFromName",
-               tmc.channel_id         as "channelId",
-               tmsc.channel_name      as "channelName",
-               tmc.org_id             as "orgId",
-               tmo.org_name           as "orgName",
-               tmc.staff_id           as "staffId",
-               tms.staff_name         as "staffName",
-               tmc.report_staff       as "reportStaff",
-               reportstaff.staff_name as "reportStaffName",
-               tmc.report_time        as "reportTime",
-               tmc.sale_status        as "saleStatus",
-               tmc.remarks            as "remarks",
-               tmc.follow_staffs      as "followStaffs",
-               tmc.last_follow_staff  as "lastFollowStaff",
-               tmc.last_follow_id     as "lastFollowId",
-               tmc.last_follow_status as "lastFollowStatus",
-               tmc.last_follow_time   as "lastFollowTime"
+        tmc.cus_code           as "cusCode",
+        tmc.cus_name           as "cusName",
+        tmc.cus_phone          as "cusPhone",
+        tmc.address_area       as "addressArea",
+        tmc.address_name       as "addressName",
+        tmc.address_no         as "addressNo",
+        tmc.address_gcj02      as "addressGcj02",
+        tmc.address_full       as "addressFull",
+        tmc.contact_name       as "contactName",
+        tmc.contact_phone      as "contactPhone",
+        tmc.cus_from           as "cusFrom",
+        tmdd.data_value        as "cusFromName",
+        tmc.channel_id         as "channelId",
+        tmsc.channel_name      as "channelName",
+        tmc.org_id             as "orgId",
+        tmo.org_name           as "orgName",
+        tmc.staff_id           as "staffId",
+        tms.staff_name         as "staffName",
+        tmc.report_staff       as "reportStaff",
+        reportstaff.staff_name as "reportStaffName",
+        tmc.report_time        as "reportTime",
+        tmc.sale_status        as "saleStatus",
+        tmc.remarks            as "remarks",
+        tmc.follow_staffs      as "followStaffs",
+        tmc.last_follow_staff  as "lastFollowStaff",
+        tmc.last_follow_id     as "lastFollowId",
+        tmc.last_follow_status as "lastFollowStatus",
+        tmc.last_follow_time   as "lastFollowTime"
         from dkic_b.t_mst_customer as tmc
-                 inner join dkic_b.t_mst_org tmo on tmc.org_id = tmo.org_id
-                 inner join dkic_b.t_mst_staff tms on tmc.staff_id = tms.staff_id
-                 inner join dkic_b.t_mst_staff as reportstaff on tmc.report_staff = reportstaff.staff_id
-                 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
+        inner join dkic_b.t_mst_org tmo on tmc.org_id = tmo.org_id
+        inner join dkic_b.t_mst_staff tms on tmc.staff_id = tms.staff_id
+        inner join dkic_b.t_mst_staff as reportstaff on tmc.report_staff = reportstaff.staff_id
+        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}
+        AND tmc.cp_id = #{cpId}
         <if test="skuCode != null">
             AND tmc.cus_code = #{cusCode}
         </if>
@@ -524,7 +524,7 @@
         count(1)
         from dkic_b.t_mst_customer as tmc
         where tmc.flg_valid
-          and tmc.cp_id = #{cpId}
+        and tmc.cp_id = #{cpId}
         <if test="skuCode != null">
             AND tmc.cus_code = #{cusCode}
         </if>
@@ -591,13 +591,13 @@
     <!--获取渠道 -->
     <select id="getChannel" resultType="java.util.Map">
         select c.channel_id   as "channelId",
-               c.channel_code as "channelCode",
-               c.channel_name as "channelName",
-               c.sys_code     as "sysCode",
-               c.display_no   as "displayNo"
+        c.channel_code as "channelCode",
+        c.channel_name as "channelName",
+        c.sys_code     as "sysCode",
+        c.display_no   as "displayNo"
         from dkic_b.t_mst_sale_channel as c
         where c.flg_valid
-          and c.cp_id = #{cpId}
+        and c.cp_id = #{cpId}
         <if test="channel_code!=null and channel_code!=''">
             AND c.channel_code LIKE concat('%', #{channelCode}, '%')
         </if>
@@ -613,6 +613,7 @@
         </if>
     </select>
 
+    <!-- 查询商品档案-->
     <select id="getGoodsBrand" resultType="java.util.Map">
         SELECT
         tmgb.flg_valid AS "flgValid",
@@ -624,18 +625,16 @@
         FROM dkic_b.t_mst_goods_brand tmgb
         <where>
             <if test="searchText !=null">
-                AND   tmgb.brand_name LIKE concat('%', #{searchText}, '%')
+                AND   tmgb.brand_name LIKE concat('%',my_ex.likequery(#{searchText}), '%')
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
+                AND tmgb.cp_id = #{cpId}
             </if>
         </where>
-        order by display_no asc
+        order by tmgb.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,(条件查询)个数 -->
@@ -648,10 +647,11 @@
                 AND  tmgb.brand_name LIKE concat('%', #{searchText}, '%')
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
+                AND tmgb.cp_id = #{cpId}
             </if>
         </where>
     </select>
+    <!--    查询商品种类-->
     <select id="getGoodsCategory" resultType="java.util.Map">
         SELECT
         cat_id AS "catId",
@@ -662,8 +662,8 @@
         FROM dkic_b.t_mst_goods_category
         <where>
             <if test="searchText !=null">
-                AND ( cat_name LIKE concat('%', #{searchText}, '%')
-                or   remarks LIKE concat('%', #{searchText}, '%'))
+                AND ( cat_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+                or   remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
             </if>
             <if test="cpId != null">
                 AND cp_id = #{cpId}
@@ -675,9 +675,10 @@
         </if>
 
     </select>
+    <!--    查询商品种类的个数-->
     <select id="countGoodsCategory" resultType="java.lang.Long">
         SELECT
-            count(1)
+        count(1)
         FROM dkic_b.t_mst_goods_category
         <where>
             <if test="searchText !=null">
@@ -689,6 +690,7 @@
             </if>
         </where>
     </select>
+    <!--    查询商品系列-->
     <select id="getGoodsSeries" resultType="java.util.Map">
         SELECT
         series_id AS "seriesId",
@@ -698,8 +700,8 @@
         FROM dkic_b.t_mst_goods_series
         <where>
             <if test="searchText !=null">
-                AND ( series_name LIKE concat('%', #{searchText}, '%')
-                or   remarks LIKE concat('%', #{searchText}, '%'))
+                AND ( series_name LIKE concat('%',my_ex.likequery(#{searchText}), '%')
+                or   remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
             </if>
             <if test="cpId != null">
                 AND cp_id = #{cpId}
@@ -711,14 +713,15 @@
         </if>
     </select>
 
+    <!--    商品系列个数-->
     <select id="countGoodsSeries" resultType="java.lang.Long">
         SELECT
-            count(1)
+        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}, '%'))
+                AND ( series_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+                or   remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
             </if>
             <if test="cpId != null">
                 AND cp_id = #{cpId}
@@ -726,6 +729,7 @@
         </where>
     </select>
 
+    <!--    获取计量单位-->
     <select id="getUnit" resultType="java.util.Map">
         SELECT
         unit_id AS "unitId",
@@ -736,8 +740,8 @@
         FROM  dkic_b.t_mst_unit
         <where>
             <if test="searchText !=null">
-                AND ( unit_name LIKE concat('%', #{searchText}, '%')
-                or   remarks LIKE concat('%', #{searchText}, '%'))
+                AND ( unit_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+                or   remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
             </if>
             <if test="cpId != null">
                 AND cp_id = #{cpId}
@@ -749,14 +753,15 @@
         </if>
     </select>
 
+    <!--    获取计量单位个数-->
     <select id="countUnit" resultType="java.lang.Long">
         SELECT
-            count(1)
+        count(1)
         FROM  dkic_b.t_mst_unit
         <where>
             <if test="searchText !=null">
-                AND ( unit_name LIKE concat('%', #{searchText}, '%')
-                or   remarks LIKE concat('%', #{searchText}, '%'))
+                AND ( unit_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+                or   remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
             </if>
             <if test="cpId != null">
                 AND cp_id = #{cpId}
@@ -776,8 +781,8 @@
         FROM  dkic_b.t_mst_warehouse
         <where>
             <if test="searchText !=null">
-                AND ( wh_name LIKE concat('%', #{searchText}, '%')
-                or  remarks LIKE concat('%', #{searchText}, '%'))
+                AND ( wh_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+                or  remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
             </if>
             <if test="cpId != null">
                 AND cp_id = #{cpId}
@@ -796,8 +801,8 @@
         FROM  dkic_b.t_mst_warehouse
         <where>
             <if test="searchText !=null">
-                AND ( wh_name LIKE concat('%', #{searchText}, '%')
-                or  remarks LIKE concat('%', #{searchText}, '%'))
+                AND ( wh_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+                or  remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
             </if>
             <if test="cpId != null">
                 AND cp_id = #{cpId}
@@ -808,41 +813,41 @@
     <!-- 查询库存 -->
     <select id="getInventory" resultType="java.util.Map">
         select tpi.sku_id            as "skuId",
-               tmgs.sku_code          as "skuCode",
-               tmgs.sku_name          as "skuName",
-               tmgs.sku_model         as "skuModel",
-               tmgs.brand_id          as "brandId",
-               tmgb.brand_name        as "brandName",
-               tmgs.category_id       as "categoryId",
-               tmgc.cat_name          as "categoryName",
-               tmgs.unit_id           as "unitId",
-               tmgu.unit_name         as "unitName",
-               tmgs.sub_unit_id       as "subUnitId",
-               tmgs.conversion_factor as "conversionFactor",
-               tmgs.series_id         as "seriesId",
-               tmgseries.series_name  as "seriesName",
-               tmgs.sku_spec          as "skuSpec",
-               tmgs.price_purchase    as "pricePurchase",
-               tmgs.price_standard    as "priceStandard",
-               tmgs.price_wholesale   as "priceWholesale",
-               tmgs.price_limited     as "priceLimited",
-               tmgs.sku_images        as "skuImages",
-               tpi.non_std_code       as "nonStdCode",
-               tpi.inv_qty            as "invQty",
-               tpi.outing_qty         as "outingQty",
-               tpi.usable_qty         as "usableQty",
-               tmw.wh_code            as "whCode",
-               tmw.wh_name            as "whName",
-               tpi.remarks
+        tmgs.sku_code          as "skuCode",
+        tmgs.sku_name          as "skuName",
+        tmgs.sku_model         as "skuModel",
+        tmgs.brand_id          as "brandId",
+        tmgb.brand_name        as "brandName",
+        tmgs.category_id       as "categoryId",
+        tmgc.cat_name          as "categoryName",
+        tmgs.unit_id           as "unitId",
+        tmgu.unit_name         as "unitName",
+        tmgs.sub_unit_id       as "subUnitId",
+        tmgs.conversion_factor as "conversionFactor",
+        tmgs.series_id         as "seriesId",
+        tmgseries.series_name  as "seriesName",
+        tmgs.sku_spec          as "skuSpec",
+        tmgs.price_purchase    as "pricePurchase",
+        tmgs.price_standard    as "priceStandard",
+        tmgs.price_wholesale   as "priceWholesale",
+        tmgs.price_limited     as "priceLimited",
+        tmgs.sku_images        as "skuImages",
+        tpi.non_std_code       as "nonStdCode",
+        tpi.inv_qty            as "invQty",
+        tpi.outing_qty         as "outingQty",
+        tpi.usable_qty         as "usableQty",
+        tmw.wh_code            as "whCode",
+        tmw.wh_name            as "whName",
+        tpi.remarks
         from dkic_b.t_psi_inventory as tpi
-                 inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
-                 inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_id
-                 left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
-                 left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
-                 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
+        inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
+        inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_id
+        left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
+        left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
+        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 tpi.flg_valid
-          AND tpi.cp_id = #{cpId}
+        AND tpi.cp_id = #{cpId}
         <if test="skuId != null">
             AND tpi.sku_id = #{skuId} ::uuid
         </if>
@@ -865,10 +870,10 @@
         SELECT
         count(1)
         from dkic_b.t_psi_inventory as tpi
-                inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
-                inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_id
+        inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
+        inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_id
         where tpi.flg_valid
-          AND tpi.cp_id = #{cpId}
+        AND tpi.cp_id = #{cpId}
         <if test="skuId != null">
             AND tpi.sku_id = #{skuId} ::uuid
         </if>
@@ -886,53 +891,13 @@
         </if>
     </select>
 
-    <select id="getDictionaryDataByPage" resultType="java.util.Map">
-        SELECT
-        data_id AS dataId,
-        dict_code AS dictCode,
-        data_code AS dataCode,
-        data_value AS dataValue
-        FROM dkic_b.t_mst_dictionary_data
-        <where>
-              dict_code = '账户类别'
-            <if test="searchText !=null">
-                AND ( mac_name LIKE concat('%', #{searchText}, '%')
-                or  remarks LIKE concat('%', #{searchText}, '%'))
-            </if>
-            <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-
-        </where>
-        order by CASE WHEN flg_default = true THEN 0 ELSE 1 END, display_no
-        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
-            limit #{end} offset #{start}
-        </if>
 
-
-    </select>
-
-    <select id="countDictionaryDataByPage" resultType="java.lang.Long">
-        SELECT
-        count(1)
-        FROM  dkic_b.t_mst_dictionary_data
-        <where>
-            <if test="searchText !=null">
-                AND ( mac_name LIKE concat('%', #{searchText}, '%')
-                or  remarks LIKE concat('%', #{searchText}, '%'))
-            </if>
-            <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-        </where>
-
-    </select>
-<!--    获取销售渠道-->
+    <!--    获取销售渠道-->
     <select id="getSaleChannel" resultType="java.util.Map">
         SELECT
-            channel_id AS channelId,
-            channel_code AS channelCode,
-            channel_name AS channelName
+        channel_id AS channelId,
+        channel_code AS channelCode,
+        channel_name AS channelName
         FROM dkic_b.t_mst_sale_channel
         <where>
             <if test="cpId != null">
@@ -940,7 +905,7 @@
             </if>
         </where>
     </select>
-<!--获取员工-->
+    <!--获取员工-->
     <select id="getStaff" resultType="java.util.Map">
         SELECT
         staff_id AS staffId,
@@ -953,6 +918,4 @@
             </if>
         </where>
     </select>
-
-
 </mapper>

+ 12 - 25
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -8,7 +8,6 @@ import com.dk.common.mapper.BaseMapper;
 import com.dk.common.model.pojo.PageList;
 import com.dk.common.model.vo.core.StaffEntity;
 import com.dk.common.model.vo.core.UserVO;
-import com.dk.common.model.wxapi.wxResponse.WxCommonResponse;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
@@ -16,7 +15,6 @@ import com.dk.common.service.BaseService;
 import com.dk.mdm.mapper.common.CommonMapper;
 import com.dk.mdm.infrastructure.util.AuthUtils;
 import com.dk.mdm.mapper.mst.StaffMapper;
-import com.dk.mdm.model.query.wxapi.basic.WxCommonQuery;
 import com.dk.mdm.model.response.mst.StaffResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.postgresql.util.PGobject;
@@ -404,9 +402,9 @@ public class CommonService extends BaseService<Map<String, Object>> {
     }
 
     /**
-     * @desc : 获取商品(销售订单开单用)
+     * @desc   : 获取商品(销售订单开单用)
      * @author : 付斌
-     * @date : 2024-03-09 9:57
+     * @date   : 2024-03-09 9:57
      */
     public ResponseResultVO<List<Map<String, Object>>> getGoodsForOrder(Map<String, Object> param) {
         // 获取系统基础数据
@@ -415,9 +413,9 @@ public class CommonService extends BaseService<Map<String, Object>> {
     }
 
     /**
-     * @desc : 获取商品(销售订单开单用)(分页)
+     * @desc   : 获取商品(销售订单开单用)(分页)
      * @author : 付斌
-     * @date : 2024-03-09 9:57
+     * @date   : 2024-03-09 9:57
      */
     public ResponseResultVO<PageList<Map<String, Object>>> getGoodsForOrderByPage(Map<String, Object> param) {
         // 校验分页参数
@@ -432,9 +430,9 @@ public class CommonService extends BaseService<Map<String, Object>> {
 
 
     /**
-     * @desc : 获取商品(采购订单开单用)
+     * @desc   : 获取商品(采购订单开单用)
      * @author : 常皓宁
-     * @date : 2024/3/9 10:08
+     * @date   : 2024/3/9 10:08
      */
     public ResponseResultVO<List<Map<String, Object>>> getGoodsForPurchase(Map<String, Object> param) {
         // 获取系统基础数据
@@ -443,9 +441,9 @@ public class CommonService extends BaseService<Map<String, Object>> {
     }
 
     /**
-     * @desc : 获取商品(采购订单开单用)(分页)
+     * @desc   : 获取商品(采购订单开单用)(分页)
      * @author : 常皓宁
-     * @date : 2024/3/9 10:08
+     * @date   : 2024/3/9 10:08
      */
     public ResponseResultVO<PageList<Map<String, Object>>> getGoodsForPurchaseByPage(Map<String, Object> param) {
         // 校验分页参数
@@ -673,9 +671,9 @@ public class CommonService extends BaseService<Map<String, Object>> {
     }
 
     /**
-     * @desc : 供应商类别
+     * @desc   : 供应商类别
      * @author : 宋扬
-     * @date : 2024/3/6 10:41
+     * @date   : 2024/3/6 10:41
      */
     public ResponseResultVO<List<Map<String, Object>>> getSupType(Map<String, Object> param) {
         // 获取系统基础数据
@@ -684,9 +682,9 @@ public class CommonService extends BaseService<Map<String, Object>> {
     }
 
     /**
-     * @desc : 供应商服务类别
+     * @desc   : 供应商服务类别
      * @author : 宋扬
-     * @date : 2024/3/6 10:43
+     * @date   : 2024/3/6 10:43
      */
     public ResponseResultVO<List<Map<String, Object>>> getServiceCategories(Map<String, Object> param) {
         // 获取系统基础数据
@@ -694,17 +692,6 @@ public class CommonService extends BaseService<Map<String, Object>> {
         return ResponseResultUtil.success(list);
     }
 
-    /**
-     * @desc : 获取仓库档案
-     * @author : 王英杰
-     * @date :2024/3/1 9:20
-     */
-    public ResponseResultVO<PageList<Map<String, Object>>> getDictionaryDataByPage(Map<String, Object> param) {
-        this.getLimit(param);
-        return super.mergeListWithCount(param, commonMapper.getDictionaryDataByPage(param),
-                commonMapper.countDictionaryDataByPage(param));
-    }
-
 
     /**
      * @desc : 获取页面数据源集合 (小程序用)