Commit ff721df9487374b52859a2c11b049cd2794922d6

Authored by yiming
1 parent 4dfd417c

档案借阅

ruoyi-archives/src/main/java/com/ruoyi/domain/ArchivesBorrow.java
@@ -11,7 +11,7 @@ import java.util.Date; @@ -11,7 +11,7 @@ import java.util.Date;
11 * @author ym 11 * @author ym
12 * @date 2022-08-23 12 * @date 2022-08-23
13 */ 13 */
14 -public class ArchivesBorrow extends BaseEntity 14 +public class ArchivesBorrow extends ArchivesCollectBox
15 { 15 {
16 private static final long serialVersionUID = 1L; 16 private static final long serialVersionUID = 1L;
17 17
@@ -97,12 +97,12 @@ public class ArchivesBorrow extends BaseEntity @@ -97,12 +97,12 @@ public class ArchivesBorrow extends BaseEntity
97 @JsonFormat(pattern = "yyyy-MM-dd") 97 @JsonFormat(pattern = "yyyy-MM-dd")
98 private Date borrowDateE; 98 private Date borrowDateE;
99 99
100 - private Long filingDept;  
101 - 100 + @Override
102 public Long getId() { 101 public Long getId() {
103 return id; 102 return id;
104 } 103 }
105 104
  105 + @Override
106 public void setId(Long id) { 106 public void setId(Long id) {
107 this.id = id; 107 this.id = id;
108 } 108 }
@@ -243,10 +243,12 @@ public class ArchivesBorrow extends BaseEntity @@ -243,10 +243,12 @@ public class ArchivesBorrow extends BaseEntity
243 this.borrowMark = borrowMark; 243 this.borrowMark = borrowMark;
244 } 244 }
245 245
  246 + @Override
246 public String getStatus() { 247 public String getStatus() {
247 return status; 248 return status;
248 } 249 }
249 250
  251 + @Override
250 public void setStatus(String status) { 252 public void setStatus(String status) {
251 this.status = status; 253 this.status = status;
252 } 254 }
@@ -266,39 +268,4 @@ public class ArchivesBorrow extends BaseEntity @@ -266,39 +268,4 @@ public class ArchivesBorrow extends BaseEntity
266 public void setBorrowDateE(Date borrowDateE) { 268 public void setBorrowDateE(Date borrowDateE) {
267 this.borrowDateE = borrowDateE; 269 this.borrowDateE = borrowDateE;
268 } 270 }
269 -  
270 - public Long getFilingDept() {  
271 - return filingDept;  
272 - }  
273 -  
274 - public void setFilingDept(Long filingDept) {  
275 - this.filingDept = filingDept;  
276 - }  
277 -  
278 - @Override  
279 - public String toString() {  
280 - return "ArchivesBorrow{" +  
281 - "id=" + id +  
282 - ", name='" + name + '\'' +  
283 - ", dept='" + dept + '\'' +  
284 - ", borrowDate=" + borrowDate +  
285 - ", phone='" + phone + '\'' +  
286 - ", mode='" + mode + '\'' +  
287 - ", boxType='" + boxType + '\'' +  
288 - ", borrowName='" + borrowName + '\'' +  
289 - ", borrowType='" + borrowType + '\'' +  
290 - ", collectBoxId='" + collectBoxId + '\'' +  
291 - ", createBy='" + createBy + '\'' +  
292 - ", createTime=" + createTime +  
293 - ", updateBy='" + updateBy + '\'' +  
294 - ", updateTime=" + updateTime +  
295 - ", returnDate=" + returnDate +  
296 - ", returnedDate=" + returnedDate +  
297 - ", borrowMark='" + borrowMark + '\'' +  
298 - ", status='" + status + '\'' +  
299 - ", borrowDateS=" + borrowDateS +  
300 - ", borrowDateE=" + borrowDateE +  
301 - ", filingDept=" + filingDept +  
302 - '}';  
303 - }  
304 } 271 }
ruoyi-archives/src/main/resources/mapper/archives/ArchivesBorrowMapper.xml
@@ -25,6 +25,30 @@ @@ -25,6 +25,30 @@
25 <result property="status" column="status" /> 25 <result property="status" column="status" />
26 </resultMap> 26 </resultMap>
27 27
  28 + <resultMap type="ArchivesBorrow" id="ArchivesBorrowAndBox">
  29 + <result property="id" column="id" />
  30 + <result property="name" column="name" />
  31 + <result property="dept" column="dept" />
  32 + <result property="borrowDate" column="borrow_date" />
  33 + <result property="phone" column="phone" />
  34 + <result property="mode" column="mode" />
  35 + <result property="boxType" column="box_type" />
  36 + <result property="borrowName" column="borrow_name" />
  37 + <result property="borrowType" column="borrow_type" />
  38 + <result property="collectBoxId" column="collect_box_id" />
  39 + <result property="createBy" column="create_by" />
  40 + <result property="createTime" column="create_time" />
  41 + <result property="updateBy" column="update_by" />
  42 + <result property="updateTime" column="update_time" />
  43 + <result property="returnDate" column="return_date" />
  44 + <result property="returnedDate" column="returned_date" />
  45 + <result property="borrowMark" column="borrow_mark" />
  46 + <result property="status" column="status" />
  47 + <result property="archivalCode" column="archival_code" />
  48 + <result property="title" column="title" />
  49 + <result property="borrowStatus" column="borrow_status" />
  50 + </resultMap>
  51 +
28 <sql id="selectArchivesBorrowVo"> 52 <sql id="selectArchivesBorrowVo">
29 select * from archives_borrow 53 select * from archives_borrow
30 </sql> 54 </sql>
@@ -41,15 +65,16 @@ @@ -41,15 +65,16 @@
41 </where> 65 </where>
42 </select> 66 </select>
43 67
44 - <select id="selectArchivesBorrowListByFilingDept" parameterType="ArchivesBorrow" resultMap="ArchivesBorrowResult">  
45 - select a.* from archives_borrow a,archives_collect_box b where a.collect_box_id=b.id 68 + <select id="selectArchivesBorrowListByFilingDept" parameterType="ArchivesBorrow" resultMap="ArchivesBorrowAndBox">
  69 + select a.*,b.* from archives_borrow a,archives_collect_box b,archives_dept c
  70 + where a.collect_box_id=b.id and b.filing_dept=c.dept_id
46 <if test="name != null and name != ''"> and a.name = #{name}</if> 71 <if test="name != null and name != ''"> and a.name = #{name}</if>
47 <if test="dept != null and dept != ''"> and a.dept = #{dept}</if> 72 <if test="dept != null and dept != ''"> and a.dept = #{dept}</if>
48 <if test="borrowDate != null and borrowDate != ''"> and a.borrow_date = #{borrowDate}</if> 73 <if test="borrowDate != null and borrowDate != ''"> and a.borrow_date = #{borrowDate}</if>
49 <if test="borrowDateS != null and borrowDateS != ''"> and a.borrow_date >= #{borrowDateS}</if> 74 <if test="borrowDateS != null and borrowDateS != ''"> and a.borrow_date >= #{borrowDateS}</if>
50 <if test="borrowDateE != null and borrowDateE != ''"> and a.borrow_date &lt;= #{borrowDateE}</if> 75 <if test="borrowDateE != null and borrowDateE != ''"> and a.borrow_date &lt;= #{borrowDateE}</if>
51 <if test="borrowMark != null and borrowMark != ''"> and a.borrow_mark = #{borrowMark}</if> 76 <if test="borrowMark != null and borrowMark != ''"> and a.borrow_mark = #{borrowMark}</if>
52 - <if test="filingDept != null and filingDept != ''"> and b.filing_dept = #{filingDept}</if> 77 + <if test="filingDept != null and filingDept != ''"> AND (b.filing_dept=#{filingDept} or FIND_IN_SET(#{filingDept},c.ancestors))</if>
53 </select> 78 </select>
54 79
55 </mapper> 80 </mapper>
56 \ No newline at end of file 81 \ No newline at end of file