|
@ -5,7 +5,9 @@ import com.ai.ipu.data.JMap;
|
5
|
5
|
import com.ai.ipu.data.impl.JsonList;
|
6
|
6
|
import com.ai.ipu.data.impl.JsonMap;
|
7
|
7
|
import com.ai.ipu.database.dao.IpuDaoManager;
|
|
8
|
import com.ai.ipu.database.dao.impl.AbstractBizDao;
|
8
|
9
|
import com.ai.ipu.server.dao.interfaces.EquipmentManageDao;
|
|
10
|
import com.ai.ipu.server.dao.interfaces.MapTagManageDao;
|
9
|
11
|
import com.ai.ipu.sql.mgmt.ISqlMgmtDao;
|
10
|
12
|
import com.ai.ipu.sql.mgmt.SqlMgmtDaoFactory;
|
11
|
13
|
import com.alibaba.fastjson.JSON;
|
|
@ -14,44 +16,49 @@ import com.github.pagehelper.PageHelper;
|
14
|
16
|
import com.github.pagehelper.PageInfo;
|
15
|
17
|
import org.springframework.stereotype.Component;
|
16
|
18
|
|
|
19
|
import java.io.IOException;
|
17
|
20
|
import java.util.ArrayList;
|
18
|
21
|
import java.util.HashMap;
|
19
|
22
|
import java.util.List;
|
20
|
23
|
import java.util.Map;
|
21
|
24
|
|
22
|
25
|
@Component
|
23
|
|
public class EquipmentManageDaoImpl implements EquipmentManageDao {
|
|
26
|
public class EquipmentManageDaoImpl extends AbstractBizDao implements EquipmentManageDao {
|
24
|
27
|
|
25
|
|
private String connName = "ebc";
|
|
28
|
public static String connName = "ebc";
|
26
|
29
|
private String equipmentTableName = "LR_FACILITY"; //设施表
|
27
|
30
|
|
|
31
|
public EquipmentManageDaoImpl() throws IOException {
|
|
32
|
super(connName);
|
|
33
|
}
|
|
34
|
|
28
|
35
|
@Override
|
29
|
36
|
public PageInfo queryEquipmentInfo(JMap params) throws Exception {
|
30
|
|
JMap params1 = params.getJMap("params");
|
31
|
|
PageHelper.startPage(params1.getInt("pageNum"),params1.getInt("pageSize"));
|
32
|
|
ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
|
33
|
|
List<Map<String, Object>> equipmentList= dao.executeSelect("ipu.EquipmentManageDao", "queryEquipmentInfo", params1);
|
|
37
|
// 当前页数
|
|
38
|
int pageNum = params.getInt("pageNum") < 1 ? 1 : params.getInt("pageNum");
|
|
39
|
// 每页条数
|
|
40
|
int pageSize = params.getInt("pageSize") < 1 ? 10 : params.getInt("pageSize");
|
|
41
|
PageHelper.startPage(pageNum,pageSize);
|
|
42
|
ISqlMgmtDao dao1 = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
|
|
43
|
List<Map<String, Object>> equipmentList= dao1.executeSelect("ipu.EquipmentManageDao", "queryEquipmentInfo", params);
|
34
|
44
|
PageInfo pageInfo = new PageInfo(equipmentList);
|
35
|
45
|
return pageInfo;
|
36
|
46
|
}
|
37
|
47
|
|
38
|
48
|
@Override
|
39
|
49
|
public int modifyEquipmentInfo (JMap params) throws Exception {
|
40
|
|
CommonTableDao dao = IpuDaoManager.takeDao(CommonTableDao.class, connName);
|
41
|
50
|
int i = dao.update(equipmentTableName, params);
|
42
|
51
|
return i;
|
43
|
52
|
}
|
44
|
53
|
|
45
|
54
|
@Override
|
46
|
55
|
public int addEquipmentInfo(JMap params) throws Exception {
|
47
|
|
CommonTableDao dao = IpuDaoManager.takeDao(CommonTableDao.class, connName);
|
48
|
56
|
int i = dao.insert(equipmentTableName, params);
|
49
|
57
|
return i;
|
50
|
58
|
}
|
51
|
59
|
|
52
|
60
|
@Override
|
53
|
61
|
public boolean deleteEquipmentInfo(JMap params) throws Exception {
|
54
|
|
CommonTableDao dao = IpuDaoManager.takeDao(CommonTableDao.class, connName);
|
55
|
62
|
int num = dao.delete(equipmentTableName, params);
|
56
|
63
|
if(num>0){
|
57
|
64
|
return true;
|
|
@ -71,7 +78,6 @@ public class EquipmentManageDaoImpl implements EquipmentManageDao {
|
71
|
78
|
|
72
|
79
|
@Override
|
73
|
80
|
public Map<String, Object> verifyEquipmentInfoRepetition(JMap params) throws Exception {
|
74
|
|
CommonTableDao dao = IpuDaoManager.takeDao(CommonTableDao.class, connName);
|
75
|
81
|
List<Map<String, Object>> verifyList=new ArrayList<>();
|
76
|
82
|
//验证修改重复
|
77
|
83
|
if(params.get("FACILITY_ID")!=null&¶ms.get("FACILITY_ID")!=""){
|