ソースを参照

影像资料查询 没有判断is_deleted=0

cr 1 ヶ月 前
コミット
0b7d540e66

+ 54 - 51
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ImageClassificationFileMapper.xml

@@ -73,60 +73,63 @@
 
     <select id="selectImageClassificationFilePage" resultMap="imageClassificationFileResultMap">
         select
-            files.id,
-            files.title,
-            files.text_content,
-            files.shooting_user,
-            files.shooting_time,
-            files.file_size,
-            files.image_url,
-            files.pdf_url,
-            files.type,
-            files.marge_pdf_url,
-            files.create_time,
-            files.wbs_id
+        files.id,
+        files.title,
+        files.text_content,
+        files.shooting_user,
+        files.shooting_time,
+        files.file_size,
+        files.image_url,
+        files.pdf_url,
+        files.type,
+        files.marge_pdf_url,
+        files.create_time,
+        files.wbs_id
         from
         (
-            select
-                wbs_id,
-                create_time,
-                id,
-                title,
-                text_content,
-                shooting_user,
-                shooting_time,
-                file_size,
-                image_url,
-                pdf_url,
-                marge_pdf_url,
-                type,
-                date_format(shooting_time,'%Y-%m-%d') as shootingTimeStr
-            from u_image_classification_file
-            where is_deleted = 0 and status = 1
-                and project_id = #{param.projectId}
-                and classify_id = #{param.classifyId}
-            <if test="param.contractId != null and param.contractId != ''">
-                and contract_id = #{param.contractId}
-            </if>
-            <if test="param.queryStr != null and param.queryStr != ''">
-                and (title like concat('%',#{param.queryStr},'%') OR shooting_user like concat('%',#{param.queryStr},'%'))
-            </if>
-            <if test="param.wbsIds != null and param.wbsIds.size != 0">
-                and wbs_id in
-                <foreach collection="param.wbsIds" item="wbsId" open="(" separator="," close=")">
-                    #{wbsId}
-                </foreach>
-            </if>
-            <if test="param.staDate != null and param.staDate != ''">
-                <![CDATA[ and  shooting_time >= DATE_FORMAT(#{param.staDate}, '%Y-%m-%d %H:%i:%S') ]]>
-            </if>
-            <if test="param.endDate != null and param.endDate != ''">
-                <![CDATA[ and  shooting_time <= DATE_FORMAT(#{param.endDate}, '%Y-%m-%d %H:%i:%S') ]]>
-            </if>
-                order by shooting_time desc
-            ) as files
+        select
+        uicf.wbs_id,
+        uicf.create_time,
+        uicf.id,
+        uicf.title,
+        uicf.text_content,
+        uicf.shooting_user,
+        uicf.shooting_time,
+        uicf.file_size,
+        uicf.image_url,
+        uicf.pdf_url,
+        uicf.marge_pdf_url,
+        uicf.type,
+        date_format(uicf.shooting_time,'%Y-%m-%d') as shootingTimeStr
+        from u_image_classification_file uicf
+        <if test="param.wbsIds == null or param.wbsIds.size == 0">
+            JOIN m_wbs_tree_contract mwtc ON uicf.wbs_id = mwtc.p_key_id AND mwtc.is_deleted = 0
+        </if>
+        where uicf.is_deleted = 0 and uicf.status = 1
+        and uicf.project_id = #{param.projectId}
+        and uicf.classify_id = #{param.classifyId}
+        <if test="param.contractId != null and param.contractId != ''">
+            and uicf.contract_id = #{param.contractId}
+        </if>
+        <if test="param.queryStr != null and param.queryStr != ''">
+            and (uicf.title like concat('%',#{param.queryStr},'%') OR uicf.shooting_user like concat('%',#{param.queryStr},'%'))
+        </if>
+        <if test="param.wbsIds != null and param.wbsIds.size != 0">
+            and uicf.wbs_id in
+            <foreach collection="param.wbsIds" item="wbsId" open="(" separator="," close=")">
+                #{wbsId}
+            </foreach>
+        </if>
+        <if test="param.staDate != null and param.staDate != ''">
+            <![CDATA[ and uicf.shooting_time >= DATE_FORMAT(#{param.staDate}, '%Y-%m-%d %H:%i:%S') ]]>
+        </if>
+        <if test="param.endDate != null and param.endDate != ''">
+            <![CDATA[ and uicf.shooting_time <= DATE_FORMAT(#{param.endDate}, '%Y-%m-%d %H:%i:%S') ]]>
+        </if>
+        order by uicf.shooting_time desc
+        ) as files
         where
-            1 = 1
+        1 = 1
         <if test="param.queryDate != null and param.queryDate != ''">
             and files.shootingTimeStr like concat('%',#{param.queryDate},'%')
         </if>