|
|
@@ -502,6 +502,92 @@
|
|
|
) AS distinct_projects
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getSearchProjectCount" parameterType="com.siwei.apply.domain.vo.ProjectFilterVo" resultType="int">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM (
|
|
|
+ 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,
|
|
|
+ '1' AS selectType,
|
|
|
+ '' AS attachmentId,
|
|
|
+ '' AS nodeId ,
|
|
|
+ '' AS fileName,
|
|
|
+ '' AS filePath
|
|
|
+ FROM PUBLIC.t_project P
|
|
|
+ <where>
|
|
|
+ <if test="keyWords != null and keyWords.size() > 0">
|
|
|
+ regexp_like(P.name,
|
|
|
+ REGEXP_REPLACE(
|
|
|
+ <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
|
|
|
+ , '[\r\n\s]+', '', 'g')
|
|
|
+ , 'i')
|
|
|
+ OR
|
|
|
+ regexp_like(P.code,
|
|
|
+ REGEXP_REPLACE(
|
|
|
+ <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
|
|
|
+ , '[\r\n\s]+', '', 'g')
|
|
|
+ , 'i')
|
|
|
+ OR
|
|
|
+ regexp_like(P.company,
|
|
|
+ REGEXP_REPLACE(
|
|
|
+ <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
|
|
|
+ , '[\r\n\s]+', '', 'g')
|
|
|
+ , 'i')
|
|
|
+ </if>
|
|
|
+ <if test="isOnchain != null and isOnchain">
|
|
|
+ AND on_chain_num > 0
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) AS distinct_projects
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getSearchAttachmentCount" parameterType="com.siwei.apply.domain.vo.ProjectFilterVo" resultType="int">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM (
|
|
|
+ SELECT
|
|
|
+ project."id" AS ID,
|
|
|
+ project."name" AS NAME,
|
|
|
+ project."code" AS code,
|
|
|
+ project."company" AS company,
|
|
|
+ project."created_at" AS createAt,
|
|
|
+ project."updated_at" AS updateAt,
|
|
|
+ project."project_type" AS projectType,
|
|
|
+ project."on_chain_num" AS onChainNum,
|
|
|
+ project."creator_id" AS creatorId,
|
|
|
+ project."updated_at" AS updatedAt,
|
|
|
+ '2' AS selectType,
|
|
|
+ info.ID AS attachmentId,
|
|
|
+ info.node_id AS nodeId,
|
|
|
+ info.file_name AS fileName,
|
|
|
+ info.file_path AS filePath
|
|
|
+ FROM PUBLIC.t_project_attachment_info info
|
|
|
+ LEFT JOIN t_project project on info.project_id=project.id
|
|
|
+ <where>
|
|
|
+ <if test="keyWords != null and keyWords.size() > 0">
|
|
|
+ regexp_like(info.file_name,
|
|
|
+ REGEXP_REPLACE(
|
|
|
+ <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
|
|
|
+ , '[\r\n\s]+', '', 'g')
|
|
|
+ , 'i')
|
|
|
+ </if>
|
|
|
+ AND project.id is not null
|
|
|
+ <if test="isOnchain != null and isOnchain">
|
|
|
+ AND on_chain_num > 0
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) AS distinct_projects
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<delete id="deleteNodeByTable">
|
|
|
DELETE FROM ${tableName}
|