|  | @@ -366,6 +366,16 @@ module.exports = app => {
 | 
	
		
			
				|  |  |              return await this.db.query(sql, sqlParam);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        async getListByArchives(tid, ids) {
 | 
	
		
			
				|  |  | +            if (ids.length === 0) return [];
 | 
	
		
			
				|  |  | +            const sql = 'SELECT c.* FROM ?? as c LEFT JOIN (SELECT sid, MAX(end_time) as end_time FROM ?? WHERE ' +
 | 
	
		
			
				|  |  | +                'tid = ? AND sid in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') GROUP BY sid) as ca ON c.id = ca.sid WHERE' +
 | 
	
		
			
				|  |  | +                ' c.tid = ? AND c.id in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') AND c.status = ? ORDER BY c.order ASC';
 | 
	
		
			
				|  |  | +            const params = [this.tableName, this.ctx.service.stageAudit.tableName, tid, tid, auditConst.stage.status.checked];
 | 
	
		
			
				|  |  | +            const list = await this.db.query(sql, params);
 | 
	
		
			
				|  |  | +            return list;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          /**
 | 
	
		
			
				|  |  |           * 获取某一期信息(报表用)
 | 
	
		
			
				|  |  |           * @param stageId
 |