From fd7b9aabefdcfa4e2f8504c77d5a4e6f4f955585 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Sun, 22 Aug 2021 14:50:28 +0800
Subject: [PATCH] 1.ftp

---
 src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml |   64 ++++++++++++++++++++++++++++++--
 1 files changed, 60 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml b/src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml
index e244f00..634329a 100644
--- a/src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml
+++ b/src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml
@@ -12,17 +12,23 @@
         left join
             blade_user bu
         on
-            bu.id = sd.user_id
+            bu.id = sd.send_directive_id
         where
         1=1
         <if test="directive.type!=null and directive.type!=''">
-            and sll.type = #{directive.type}
+            and sd.type = #{directive.type}
         </if>
         <if test="directive.startTime!=null and directive.startTime!=''">
-            and sl.send_time &gt;= #{directive.startTime}
+            and sd.send_time &gt;= #{directive.startTime}
         </if>
         <if test="directive.endTime!=null and directive.endTime!=''">
-            and sl.send_time &lt;= #{directive.endTime}
+            and sd.send_time &lt;= #{directive.endTime}
+        </if>
+        <if test="directive.sendDirectiveId!=null and directive.sendDirectiveId!=''">
+            and sd.send_directive_id like concat('%', #{directive.sendDirectiveId},'%')
+        </if>
+        <if test="directive.receiveDirectiveIds!=null and directive.receiveDirectiveIds!=''">
+            and sd.receive_directive_ids like concat('%', #{directive.receiveDirectiveIds},'%')
         </if>
     </select>
 
@@ -39,4 +45,54 @@
         </if>
     </select>
 
+    <!--查询指令图片信息集合-->
+    <select id="getDirectiveFileList" resultType="org.springblade.modules.directive.entity.DirectiveFile">
+        select * from sys_directive_file
+        where 1=1
+        <if test="id!=null and id!=''">
+            and directive_id = #{id}
+        </if>
+    </select>
+
+    <!--插入图片-->
+    <insert id="saveDirectiveFile">
+        insert into
+            sys_directive_file
+        (type,directive_id,url)
+            value
+        (#{directiveFile.type},#{directiveFile.directiveId},#{directiveFile.url})
+    </insert>
+
+    <!--删除图片-->
+    <delete id="deleteByDirectiveId">
+        delete from sys_directive_file where directive_id = #{id}
+    </delete>
+
+    <!--自定义分页-接收到的指令-->
+    <select id="selectDirectiveReplyPage" resultType="org.springblade.modules.directive.vo.DirectiveVo">
+        SELECT
+        sd.*,
+        bu.real_name sendName
+        FROM
+        sys_directive sd
+        left join
+        blade_user bu
+        on
+        bu.id = sd.send_directive_id
+        where
+        1=1
+        <if test="directive.type!=null and directive.type!=''">
+            and sd.type = #{directive.type}
+        </if>
+        <if test="directive.startTime!=null and directive.startTime!=''">
+            and sd.send_time &gt;= #{directive.startTime}
+        </if>
+        <if test="directive.endTime!=null and directive.endTime!=''">
+            and sd.send_time &lt;= #{directive.endTime}
+        </if>
+        <if test="directive.receiveDirectiveIds!=null and directive.receiveDirectiveIds!=''">
+            and sd.receive_directive_ids like concat('%', #{directive.receiveDirectiveIds},'%')
+        </if>
+    </select>
+
 </mapper>

--
Gitblit v1.9.3