部分sql代码调整,以及前端页面刷新表格功能修改
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcCardListDaoImpl.java b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcCardListDaoImpl.java
index 96d22b3..b53b532 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcCardListDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcCardListDaoImpl.java
@@ -9,6 +9,7 @@
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.persistence.TypedQuery;
+import java.util.List;
@Repository
public class NcCardListDaoImpl implements NcCardListDao {
@@ -21,9 +22,12 @@
public TNcCardlist getCleanList(String devid) {
String sql = "select t from TNcCardlist t where t.deviceid=:devid and t.operflag = 'C'";
TypedQuery<TNcCardlist> query = entityManager.createQuery(sql, TNcCardlist.class);
- query.setParameter(devid, devid);
- TNcCardlist result = query.getSingleResult();
- return result;
+ query.setParameter("devid", devid);
+ List<TNcCardlist> list = query.getResultList();
+ if (list!=null && list.size()>0){
+ return list.get(0);
+ }
+ return null;
}
@Transactional
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcDeviceDaoImpl.java b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcDeviceDaoImpl.java
index 3699289..19eff12 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcDeviceDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcDeviceDaoImpl.java
@@ -31,7 +31,7 @@
sql+="and devname like :devname ";
}
if(!buildingid.equals("")){
- sql+="and buildingid = :buildingid ";
+ sql+="and bean.buildingid = :buildingid ";
}
if (!regionid.equals("")){
sql += "and tr.regionid in "
@@ -84,7 +84,7 @@
sql+="and devname like :devname ";
}
if(!buildingid.equals("")){
- sql+="and buildingid = :buildingid ";
+ sql+="and bean.buildingid = :buildingid ";
}
if (!regionid.equals("")){
sql += "and tr.regionid in "
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcCardlist.java b/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcCardlist.java
index 1206a42..db901ee 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcCardlist.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcCardlist.java
@@ -13,7 +13,6 @@
public class TNcCardlist implements java.io.Serializable {
// Fields
-
private String listid;
private Integer custid;
private String stuempno;
diff --git a/src/main/resources/templates/ncmgr/nc_dev.html b/src/main/resources/templates/ncmgr/nc_dev.html
index 65e7069..bc9d804 100644
--- a/src/main/resources/templates/ncmgr/nc_dev.html
+++ b/src/main/resources/templates/ncmgr/nc_dev.html
@@ -774,7 +774,7 @@
}
function refreshThisTable() {
- $("#qrybtn").click();
+ commonQuery(vue, vue.devform, vue.currPage, vue.pageSize);
};
function deletedata(id) {
diff --git a/src/main/resources/templates/ncmgr/nc_devweek.html b/src/main/resources/templates/ncmgr/nc_devweek.html
index 54731e1..803fab0 100644
--- a/src/main/resources/templates/ncmgr/nc_devweek.html
+++ b/src/main/resources/templates/ncmgr/nc_devweek.html
@@ -243,7 +243,7 @@
$.ajax({
type:"get",
dataType:"json",
- url:encodeURI("[[@{/ncmgr/loaddevweekList?weekid=0&devname=}]]"),
+ url:encodeURI("[[@{/ncmgr/loaddevweekList?weekid=}]]0&devname="),
success:function(ret){
//console.log(ret);
_self.totSize=ret.PageResult.totalCount;
@@ -263,7 +263,8 @@
}
});
function refreshThisTable(){
- $("#qrybtn").click();
+
+ commonQuery(vue,vue.devweekform.weekid,vue.devweekform.devname,vue.currPage,vue.pageSize);
};
function commonQuery(_self,weekid,devname,pageNo,pageSize){
var id=weekid;
@@ -273,7 +274,7 @@
$.ajax({
type:"get",
dataType:"json",
- url:encodeURI("[[@{/ncmgr/loaddevweekList?weekid="+id+"&devname=}]]"+devname+"&pageNo="+pageNo+"&pageSize="+pageSize),
+ url:encodeURI("[[@{/ncmgr/loaddevweekList?weekid=}]]"+id+"&devname="+devname+"&pageNo="+pageNo+"&pageSize="+pageSize),
success:function(ret){
_self.totSize=ret.PageResult.totalCount;
_self.tableData=ret.PageResult.list;
diff --git a/src/main/resources/templates/ncmgr/nc_time.html b/src/main/resources/templates/ncmgr/nc_time.html
index 5a343a4..3d5099b 100644
--- a/src/main/resources/templates/ncmgr/nc_time.html
+++ b/src/main/resources/templates/ncmgr/nc_time.html
@@ -251,7 +251,7 @@
}
function refreshThisTable(){
- $("#qrybtn").click();
+ commonQuery(vue,vue.timeform.timename,vue.currPage,vue.pageSize);
};
function commonQuery(_self,timename,pageNo,pageSize){
$.ajax({
diff --git a/src/main/resources/templates/ncmgr/nc_timegrp.html b/src/main/resources/templates/ncmgr/nc_timegrp.html
index b70e045..58d531d 100644
--- a/src/main/resources/templates/ncmgr/nc_timegrp.html
+++ b/src/main/resources/templates/ncmgr/nc_timegrp.html
@@ -446,7 +446,7 @@
}
function refreshThisTable(){
- $("#qrybtn").click();
+ commonQuery(vue,vue.timegrpform.timegrpname,vue.currPage,vue.pageSize);
};
function deletedata(id){
diff --git a/src/main/resources/templates/ncmgr/nc_weektime.html b/src/main/resources/templates/ncmgr/nc_weektime.html
index 4ff6410..482fe7d 100644
--- a/src/main/resources/templates/ncmgr/nc_weektime.html
+++ b/src/main/resources/templates/ncmgr/nc_weektime.html
@@ -455,7 +455,7 @@
}
function refreshThisTable(){
- $("#qrybtn").click();
+ commonQuery(vue,vue.weektimeform.weektimename,vue.currPage,vue.pageSize);
};
function deletedata(id){
diff --git a/src/main/resources/templates/system/building.html b/src/main/resources/templates/system/building.html
index 6e4d335..90795bd 100644
--- a/src/main/resources/templates/system/building.html
+++ b/src/main/resources/templates/system/building.html
@@ -367,7 +367,7 @@
function refreshThisTable(){
- $("#qrybtn").click();
+ commonQuery(vue,vue.buildingform.regionid,vue.buildingform.buildingname,vue.currPage,vue.pageSize);
};
function timeformatter(time) {
diff --git a/src/main/resources/templates/system/dictionary.html b/src/main/resources/templates/system/dictionary.html
index 4ddfb43..b9b72f6 100644
--- a/src/main/resources/templates/system/dictionary.html
+++ b/src/main/resources/templates/system/dictionary.html
@@ -339,7 +339,7 @@
_self.dict.dictcaption=caption='';
}
function refreshThisTable(){
- $("#qrybtn").click();
+ commonQuery(vue,vue.dicttype,vue.dictcaption,vue.currPage,vue.pageSize);
ResetForm(vue);
fillSelect(vue);
};
diff --git a/src/main/resources/templates/system/operator.html b/src/main/resources/templates/system/operator.html
index 04c3623..c4a30ca 100644
--- a/src/main/resources/templates/system/operator.html
+++ b/src/main/resources/templates/system/operator.html
@@ -475,7 +475,7 @@
})
function refreshThisTable(){
- $("#qrybtn").click();
+ commonQuery(vue,vue.operatorform.operid,vue.operatorform.realname,vue.currPage,vue.pageSize);
};
function commonQuery(_self,operid,realname,pageno,pagesize){
diff --git a/src/main/resources/templates/system/region.html b/src/main/resources/templates/system/region.html
index 523bc38..0004100 100644
--- a/src/main/resources/templates/system/region.html
+++ b/src/main/resources/templates/system/region.html
@@ -296,7 +296,7 @@
})
function refreshThisTable(){
- $("#qrybtn").click();
+ commonQuery(vue,vue.regionform.regionname,vue.currPage,vue.pageSize);
};
function commonQuery(_self,regionname,pageno,pagesize){