浏览代码

增加电子监管号及总数统计

chenendian 1 周之前
父节点
当前提交
e25d2b402e
共有 1 个文件被更改,包括 42 次插入 和 17 次删除
  1. 42 17
      siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml

+ 42 - 17
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml

@@ -575,47 +575,72 @@
         FROM (
         FROM (
             <if test="filterType==0 or filterType==1">
             <if test="filterType==0 or filterType==1">
                 SELECT
                 SELECT
-                P."id" AS ID,
-                P."name" AS NAME,
-                P."code" AS code,
-                P."company" AS company,
-                P."created_at" AS createAt,
-                P."updated_at" AS updateAt,
-                P."project_type" AS projectType,
-                P."on_chain_num" AS onChainNum,
-                P."creator_id" AS creatorId,
-                P."updated_at" AS updatedAt,
+                "id" AS ID,
+                "name" AS NAME,
+                "code" AS code,
+                "company" AS company,
+                "created_at" AS createAt,
+                "updated_at" AS updateAt,
+                "project_type" AS projectType,
+                "on_chain_num" AS onChainNum,
+                "creator_id" AS creatorId,
+                "updated_at" AS updatedAt,
                 '1'  AS selectType,
                 '1'  AS selectType,
                 '' AS attachmentId,
                 '' AS attachmentId,
-                '' AS nodeId  ,
+                '' AS nodeId,
                 '' AS fileName,
                 '' AS fileName,
                 '' AS  filePath,
                 '' AS  filePath,
                 ''  AS resourceCode,
                 ''  AS resourceCode,
                 ''  AS zl,
                 ''  AS zl,
                 ''  AS area
                 ''  AS area
+                from (
+                SELECT P.*,
+                (SELECT  hbcrfapfwh   FROM "public"."t_tdgy" 	WHERE   project_id  = P.id) hbcrfapfwh,
+                (SELECT  hbcrhtbh   FROM "public"."t_tdgy"  WHERE   project_id  = P.id) hbcrhtbh,
+                (SELECT  dzjgh   FROM "public"."t_tdgy" 	WHERE   project_id  = P.id) dzjgh
                 FROM  PUBLIC.t_project P
                 FROM  PUBLIC.t_project P
+                where 	 1=1
+                <if test="isOnchain != null and isOnchain">
+                    AND on_chain_num > 0
+                </if>
+                ) as t_out
                 <where>
                 <where>
                     <if test="keyWords != null and keyWords.size() > 0">
                     <if test="keyWords != null and keyWords.size() > 0">
-                        regexp_like(P.name,
+                        regexp_like(t_out.name,
                         REGEXP_REPLACE(
                         REGEXP_REPLACE(
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
                         , 'i')
                         OR
                         OR
-                        regexp_like(P.code,
+                        regexp_like(t_out.code,
                         REGEXP_REPLACE(
                         REGEXP_REPLACE(
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
                         , 'i')
                         OR
                         OR
-                        regexp_like(P.company,
+                        regexp_like(t_out.company,
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                        OR
+                        regexp_like(t_out.hbcrfapfwh,
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                        OR
+                        regexp_like(t_out.hbcrhtbh,
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                        OR
+                        regexp_like(t_out.dzjgh,
                         REGEXP_REPLACE(
                         REGEXP_REPLACE(
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
                         , 'i')
-                    </if>
-                    <if test="isOnchain != null and isOnchain">
-                        AND on_chain_num > 0
                     </if>
                     </if>
                 </where>
                 </where>
             </if>
             </if>