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 11 * @author ym
12 12 * @date 2022-08-23
13 13 */
14   -public class ArchivesBorrow extends BaseEntity
  14 +public class ArchivesBorrow extends ArchivesCollectBox
15 15 {
16 16 private static final long serialVersionUID = 1L;
17 17  
... ... @@ -97,12 +97,12 @@ public class ArchivesBorrow extends BaseEntity
97 97 @JsonFormat(pattern = "yyyy-MM-dd")
98 98 private Date borrowDateE;
99 99  
100   - private Long filingDept;
101   -
  100 + @Override
102 101 public Long getId() {
103 102 return id;
104 103 }
105 104  
  105 + @Override
106 106 public void setId(Long id) {
107 107 this.id = id;
108 108 }
... ... @@ -243,10 +243,12 @@ public class ArchivesBorrow extends BaseEntity
243 243 this.borrowMark = borrowMark;
244 244 }
245 245  
  246 + @Override
246 247 public String getStatus() {
247 248 return status;
248 249 }
249 250  
  251 + @Override
250 252 public void setStatus(String status) {
251 253 this.status = status;
252 254 }
... ... @@ -266,39 +268,4 @@ public class ArchivesBorrow extends BaseEntity
266 268 public void setBorrowDateE(Date borrowDateE) {
267 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 25 <result property="status" column="status" />
26 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 52 <sql id="selectArchivesBorrowVo">
29 53 select * from archives_borrow
30 54 </sql>
... ... @@ -41,15 +65,16 @@
41 65 </where>
42 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 71 <if test="name != null and name != ''"> and a.name = #{name}</if>
47 72 <if test="dept != null and dept != ''"> and a.dept = #{dept}</if>
48 73 <if test="borrowDate != null and borrowDate != ''"> and a.borrow_date = #{borrowDate}</if>
49 74 <if test="borrowDateS != null and borrowDateS != ''"> and a.borrow_date >= #{borrowDateS}</if>
50 75 <if test="borrowDateE != null and borrowDateE != ''"> and a.borrow_date &lt;= #{borrowDateE}</if>
51 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 78 </select>
54 79  
55 80 </mapper>
56 81 \ No newline at end of file
... ...