2021-11-25 21:46:05 +08:00
|
|
|
|
package com.api.aiyh_pcn.patentWall.dao;
|
|
|
|
|
|
2021-11-29 10:15:16 +08:00
|
|
|
|
import aiyh.utils.Util;
|
|
|
|
|
import aiyh.utils.zwl.common.ToolUtil;
|
|
|
|
|
import com.api.aiyh_pcn.patentWall.dto.FilterWhere;
|
2021-11-25 21:46:05 +08:00
|
|
|
|
import com.api.aiyh_pcn.patentWall.vo.PatentVO;
|
2021-11-29 10:15:16 +08:00
|
|
|
|
import weaver.conn.RecordSet;
|
2021-11-25 21:46:05 +08:00
|
|
|
|
|
2021-11-29 10:15:16 +08:00
|
|
|
|
import java.util.ArrayList;
|
2021-11-25 21:46:05 +08:00
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author EBU7-dev1-ayh
|
|
|
|
|
* @create 2021/11/25 0025 15:28
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class PatentWallMapping {
|
2021-11-29 10:15:16 +08:00
|
|
|
|
private final ToolUtil toolUtil = new ToolUtil();
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getAllList(String tableName){
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String query = "select * from " + tableName;
|
|
|
|
|
rs.executeQuery(query);
|
|
|
|
|
return Util.recordSet2MapList(rs);
|
|
|
|
|
}
|
2021-12-01 10:22:22 +08:00
|
|
|
|
|
|
|
|
|
public List<Map<String,Object>> getListByFilterWhere(StringBuilder whereBuilder,List<String> args, String tableName) {
|
2021-11-29 10:15:16 +08:00
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String query = "select * from " + tableName + whereBuilder.toString().replace(" where add "," where ");
|
|
|
|
|
rs.executeQuery(query,args);
|
|
|
|
|
toolUtil.writeDebuggerLog(String.format("执行SQL: {%s} ---> 参数: {%s}",query,args));
|
|
|
|
|
return Util.recordSet2MapList(rs);
|
2021-11-25 21:46:05 +08:00
|
|
|
|
}
|
2021-12-01 10:22:22 +08:00
|
|
|
|
|
|
|
|
|
public List<Map<String,Object>> getSelectOptions(String dataResource, String dbFieldName) {
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String query = "select wbf.id,wbf.fieldname,wbf.fieldlabel,wb.tablename, " +
|
|
|
|
|
"ws.selectname,ws.selectvalue " +
|
|
|
|
|
"from workflow_billfield wbf " +
|
|
|
|
|
"left join workflow_bill wb on wbf.billid = wb.id " +
|
|
|
|
|
"left join workflow_selectitem ws on ws.fieldid = wbf.id " +
|
|
|
|
|
"where wb.tablename = ? and fieldname = ? ";
|
|
|
|
|
rs.executeQuery(query,dataResource,dbFieldName);
|
|
|
|
|
toolUtil.writeDebuggerLog(String.format("执行SQL: {%s} ---> 参数: {%s}",query,dataResource + " -- " + dbFieldName));
|
|
|
|
|
return Util.recordSet2MapList(rs);
|
|
|
|
|
}
|
2021-11-25 21:46:05 +08:00
|
|
|
|
}
|