姜永辉 2 лет назад
Родитель
Сommit
7e8db6162e

+ 37 - 4
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -1022,8 +1022,8 @@
         '供应商' as "objTypeName",
         1 as "objType",
         tms.flg_valid as "flgValid",
-        null as "phone",
-        null as "addressFull"
+        tms.contact_phone as "phone",
+        tms.return_address as "addressFull"
         from dkic_b.t_mst_supplier tms
         <where >
             <if test="flgValid">
@@ -1035,6 +1035,13 @@
             <if test="objName != null and objName != ''">
                 AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
             </if>
+            <if test="searchText != null and searchText != ''">
+                AND (
+                tms.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or tms.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or tms.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                )
+            </if>
         </where>
         union all
         select cus.cus_id as "objId",
@@ -1056,11 +1063,19 @@
             <if test="objName != null and objName != ''">
                 AND cus.cus_name LIKE concat('%',my_ex.likequery(#{objName}),'%')
             </if>
-            <if test="flgValid">
-                AND cus.flgValid
+            <if test="searchText != null and searchText != ''">
+                AND ( cus.cus_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or cus.cus_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or cus.address_full LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                )
             </if>
         </where>
         ) tt
+        <where>
+            <if test="objType != null and objType != ''">
+                AND tt.objType = #{objType}
+            </if>
+        </where>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -1087,6 +1102,13 @@
             <if test="objName != null and objName != ''">
                 AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
             </if>
+            <if test="searchText != null and searchText != ''">
+                AND (
+                tms.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or tms.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or tms.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                )
+            </if>
         </where>
         union all
         select cus.cus_id as "objId",
@@ -1108,8 +1130,19 @@
             <if test="objName != null and objName != ''">
                 AND cus.cus_name LIKE concat('%',my_ex.likequery(#{objName}),'%')
             </if>
+            <if test="searchText != null and searchText != ''">
+                AND ( cus.cus_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or cus.cus_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                or cus.address_full LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+                )
+            </if>
         </where>
         ) tt
+        <where>
+            <if test="objType != null and objType != ''">
+                AND tt.objType = #{objType}
+            </if>
+        </where>
     </select>
 
 

+ 8 - 0
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -698,6 +698,14 @@ public class CommonService extends BaseService<Map<String, Object>> {
             map.put("dictCode","基础资料-来源");
             list = commonMapper.getDictionaryData(map);
         }
+        // 基础资料的信息  入库原因
+        if (dataSourceCode.equals("baseData")) {
+            map.put("dictCode",param.get("dictCode").toString()); // 需要前台传过dictCode
+            if (!param.containsKey("dictCode") &&  param.get("dictCode") == null) {
+                return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.DATASOURCECODE_NOT.getMessage());
+            }
+            list = commonMapper.getDictionaryData(map);
+        }
         //销售渠道
         if (dataSourceCode.equals("saleChannel")) {
             list = commonMapper.getSaleChannel(map);