From 9d1eb684e0b0a3f6a9107db3cc64fc782989a654 Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期二, 11 七月 2023 09:00:02 +0800 Subject: [PATCH] App读卡问题解决 --- igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/HPhoneServiceImpl.java | 1059 ++++++++++++++++++++++++++++++---------------------------- 1 files changed, 540 insertions(+), 519 deletions(-) diff --git a/igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/HPhoneServiceImpl.java b/igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/HPhoneServiceImpl.java index 7f65933..8ab552a 100644 --- a/igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/HPhoneServiceImpl.java +++ b/igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/HPhoneServiceImpl.java @@ -9,6 +9,7 @@ import com.ld.igds.phone35.param.Phone35InoutCommonParam; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; + import java.util.Date; import java.util.HashMap; import java.util.List; @@ -16,638 +17,658 @@ /** * 鏂扮増鎵嬫満3.5锛屾暟鎹煡璇� + * * @author chen */ @Component public class HPhoneServiceImpl extends HibernateDao { - /** - * 鏌ヨ鐢ㄦ埛 - * @param username - * @return - */ - public DefaultUser getUserByUsername(String username) { - String hql = " from " + DefaultUser.class.getName() + " where username =:username"; + /** + * 鏌ヨ鐢ㄦ埛 + * + * @param username + * @return + */ + public DefaultUser getUserByUsername(String username) { + String hql = " from " + DefaultUser.class.getName() + " where username =:username"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("username", username); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("username", username); - List<DefaultUser> list = this.query(hql, args); - if(list == null || list.isEmpty()){ - return null; - } - return list.get(0); - } + List<DefaultUser> list = this.query(hql, args); + if (list == null || list.isEmpty()) { + return null; + } + return list.get(0); + } - /** - * 鑾峰彇搴撳尯鍒楄〃淇℃伅 - * @param companyId - * @return - */ - public List<DefaultDept> listDept(String companyId) { - String hql = " from " + DefaultDept.class.getName() + " where companyId =:companyId and val =:val"; + /** + * 鑾峰彇搴撳尯鍒楄〃淇℃伅 + * + * @param companyId + * @return + */ + public List<DefaultDept> listDept(String companyId) { + String hql = " from " + DefaultDept.class.getName() + " where companyId =:companyId and val =:val"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); - //搴撳尯鍚敤 - args.put("val", Constant.YN_Y); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); + //搴撳尯鍚敤 + args.put("val", Constant.YN_Y); - hql += " and parentId is not null"; - hql += " order by id"; + hql += " and parentId is not null"; + hql += " order by id"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鑾峰彇浠撳簱鍒楄〃淇℃伅 - * @param companyId - * @param deptId - * @return - */ - public List<Depot> listDepot(String companyId, String deptId) { - String hql = " from " + Depot.class.getName() + " where companyId =:companyId"; + /** + * 鑾峰彇浠撳簱鍒楄〃淇℃伅 + * + * @param companyId + * @param deptId + * @return + */ + public List<Depot> listDepot(String companyId, String deptId) { + String hql = " from " + Depot.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(deptId)){ - hql += " and deptId =:deptId"; - args.put("deptId", deptId); - } - hql += " order by id"; + if (StringUtils.isNotEmpty(deptId)) { + hql += " and deptId =:deptId"; + args.put("deptId", deptId); + } + hql += " order by id"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ鍑哄叆搴撲俊鎭紝鐢ㄤ簬鏌ヨ鍑哄叆搴撹褰曘�佸緟鍊间粨鍒楄〃绛� - * @param param - * @return - */ - public List<InoutRecord> listInoutRecord(Phone35InoutCommonParam param) { - String hql = " from " + InoutRecord.class.getName() + " where companyId =:companyId" - + " and recordStatus <>:recordStatus1 and recordStatus <>:recordStatus2"; + /** + * 鏌ヨ鍑哄叆搴撲俊鎭紝鐢ㄤ簬鏌ヨ鍑哄叆搴撹褰曘�佸緟鍊间粨鍒楄〃绛� + * + * @param param + * @return + */ + public List<InoutRecord> listInoutRecord(Phone35InoutCommonParam param) { + String hql = " from " + InoutRecord.class.getName() + " where companyId =:companyId" + + " and recordStatus <>:recordStatus1 "; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", param.getCompanyId()); - args.put("recordStatus1", InoutConstant.RECORD_STATUS_DEL); - args.put("recordStatus2", InoutConstant.RECORD_STATUS_ERROR); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", param.getCompanyId()); + args.put("recordStatus1", InoutConstant.RECORD_STATUS_DEL); - if(StringUtils.isNotEmpty(param.getDeptId())){ - hql += " and deptId =:deptId"; - args.put("deptId", param.getDeptId()); - } - if(StringUtils.isNotEmpty(param.getDeptId())){ - hql += " and progress =:progress"; - args.put("progress", param.getProgress()); - } - if(StringUtils.isNotEmpty(param.getType())){ - hql += " and type =:type"; - args.put("type", param.getType()); - } - if(null != param.getStartTime()){ - hql += " and completeTime >:startTime"; - args.put("startTime", param.getStartTime()); - } - if(null != param.getEndTime()){ - hql += " and completeTime <:endTime"; - args.put("endTime", param.getEndTime()); - } - if(StringUtils.isNotEmpty(param.getPlateNum())){ - hql += " and plateNum =:plateNum"; - args.put("plateNum", "%" + param.getPlateNum() + "%"); - } - if(StringUtils.isNotEmpty(param.getType())){ - hql += " and intelCard =:intelCard"; - args.put("intelCard", param.getIntelCard()); - } - hql += " order by registerTime"; + if (StringUtils.isNotEmpty(param.getDeptId())) { + hql += " and deptId =:deptId"; + args.put("deptId", param.getDeptId()); + } + if (StringUtils.isNotEmpty(param.getProgress())) { + hql += " and progress =:progress"; + args.put("progress", param.getProgress()); + } + if (StringUtils.isNotEmpty(param.getType())) { + hql += " and type =:type"; + args.put("type", param.getType()); + } + if (null != param.getStartTime()) { + hql += " and completeTime >:startTime"; + args.put("startTime", param.getStartTime()); + } + if (null != param.getEndTime()) { + hql += " and completeTime <:endTime"; + args.put("endTime", param.getEndTime()); + } + if (StringUtils.isNotEmpty(param.getPlateNum())) { + hql += " and plateNum =:plateNum"; + args.put("plateNum", "%" + param.getPlateNum() + "%"); + } + if (StringUtils.isNotEmpty(param.getIntelCard())) { + hql += " and intelCard =:intelCard"; + args.put("intelCard", param.getIntelCard()); + } + hql += " order by registerTime"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏍规嵁缁勭粐缂栫爜銆佸簱鍖虹紪鐮併�佹祦姘磇d鏌ヨ鍑哄叆搴撲俊鎭� - * 鐢ㄤ簬鍒ゆ柇褰撳墠鏁版嵁鏄惁鍦ㄥ�间粨娴佺▼ - * - * @param companyId - * @param deptId - * @param id - * @return - */ - public InoutRecord getInoutRecord(String companyId, String deptId, String id, String intelCard) { - String hql = " from " + InoutRecord.class.getName() + " where" + " and recordStatus <>:recordStatus1 and recordStatus <>:recordStatus2"; + /** + * 鏍规嵁缁勭粐缂栫爜銆佸簱鍖虹紪鐮併�佹祦姘磇d鏌ヨ鍑哄叆搴撲俊鎭� + * 鐢ㄤ簬鍒ゆ柇褰撳墠鏁版嵁鏄惁鍦ㄥ�间粨娴佺▼ + * + * @param companyId + * @param deptId + * @param id + * @return + */ + public InoutRecord getInoutRecord(String companyId, String deptId, String id, String intelCard) { + String hql = " from " + InoutRecord.class.getName() + " where" + " recordStatus <>:recordStatus1 "; - Map<String, Object> args = new HashMap<String, Object>(); + Map<String, Object> args = new HashMap<String, Object>(); - args.put("recordStatus1", InoutConstant.RECORD_STATUS_DEL); - args.put("recordStatus2", InoutConstant.RECORD_STATUS_ERROR); + args.put("recordStatus1", InoutConstant.RECORD_STATUS_DEL); - if(StringUtils.isNotEmpty(companyId)){ - hql += " and companyId =:companyId"; - args.put("companyId", companyId); - } - if(StringUtils.isNotEmpty(deptId)){ - hql += " and deptId =:deptId"; - args.put("deptId", deptId); - } - if(StringUtils.isNotEmpty(id)){ - hql += " and id =:id"; - args.put("id", id); - } - if(StringUtils.isNotEmpty(intelCard)){ - hql += " and intelCard =:intelCard"; - args.put("intelCard", intelCard); - } - hql += " order by registerTime"; + if (StringUtils.isNotEmpty(companyId)) { + hql += " and companyId =:companyId"; + args.put("companyId", companyId); + } + if (StringUtils.isNotEmpty(deptId)) { + hql += " and deptId =:deptId"; + args.put("deptId", deptId); + } + if (StringUtils.isNotEmpty(id)) { + hql += " and id =:id"; + args.put("id", id); + } + if (StringUtils.isNotEmpty(intelCard)) { + hql += " and intelCard =:intelCard"; + args.put("intelCard", intelCard); + } + hql += " order by registerTime desc"; - List<InoutRecord> list = this.query(hql, args); - if(null == list || list.isEmpty()){ - return null; - } - return list.get(0); - } + List<InoutRecord> list = this.query(hql, args); + if (null == list || list.isEmpty()) { + return null; + } + return list.get(0); + } - /** - * 鏌ヨ浠撴埧淇℃伅鏁版嵁----鎺ュ彛1103浣跨敤 - * @param companyId - * @param deptId - * @return - */ - public List<Building> listBuilding(String companyId, String deptId) { - String hql = " from " + Building.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ浠撴埧淇℃伅鏁版嵁----鎺ュ彛1103浣跨敤 + * + * @param companyId + * @param deptId + * @return + */ + public List<Building> listBuilding(String companyId, String deptId) { + String hql = " from " + Building.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); - if(StringUtils.isNotEmpty(deptId)){ - hql += " and deptId =:deptId"; - args.put("deptId", deptId); - } + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); + if (StringUtils.isNotEmpty(deptId)) { + hql += " and deptId =:deptId"; + args.put("deptId", deptId); + } - hql += " order by id desc"; + hql += " order by id desc"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏍规嵁浠撴埧id鑾峰彇浠撴埧淇℃伅 - * @param companyId - * @param id - * @return - */ - public Building getBuilding(String companyId, String id) { - if(StringUtils.isEmpty(id)){ - return null; - } - String hql = " from " + Building.class.getName() + " where companyId =:companyId"; + /** + * 鏍规嵁浠撴埧id鑾峰彇浠撴埧淇℃伅 + * + * @param companyId + * @param id + * @return + */ + public Building getBuilding(String companyId, String id) { + if (StringUtils.isEmpty(id)) { + return null; + } + String hql = " from " + Building.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - hql += " and id =:id"; - args.put("id", id); + hql += " and id =:id"; + args.put("id", id); - hql += " order by id desc"; + hql += " order by id desc"; - List<Building> buildings = this.query(hql, args); - if(buildings == null || buildings.isEmpty()){ - return null; - } - return buildings.get(0); - } + List<Building> buildings = this.query(hql, args); + if (buildings == null || buildings.isEmpty()) { + return null; + } + return buildings.get(0); + } - /** - * 鏌ヨ鏂囦欢淇℃伅鏁版嵁----鎺ュ彛1112浣跨敤 - * @param companyId - * @param startTime - * @param endTime - * @return - */ - public List<FileInfo> listFiles(String companyId, Date startTime, Date endTime) { - String hql = " from " + FileInfo.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ鏂囦欢淇℃伅鏁版嵁----鎺ュ彛1112浣跨敤 + * + * @param companyId + * @param startTime + * @param endTime + * @return + */ + public List<FileInfo> listFiles(String companyId, Date startTime, Date endTime) { + String hql = " from " + FileInfo.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); - if(null != startTime){ - hql += " and createTime >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and createTime <:endTime"; - args.put("endTime", endTime); - } + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); + if (null != startTime) { + hql += " and createTime >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and createTime <:endTime"; + args.put("endTime", endTime); + } - hql += " order by createTime desc"; + hql += " order by createTime desc"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ璐ㄦ鏁版嵁----鎺ュ彛1201浣跨敤 - * @param companyId - * @param depotId - * @param startTime - * @param endTime - * @return - */ - public List<MQuality> listQuality(String companyId, String depotId, Date startTime, Date endTime) { - String hql = " from " + MQuality.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ璐ㄦ鏁版嵁----鎺ュ彛1201浣跨敤 + * + * @param companyId + * @param depotId + * @param startTime + * @param endTime + * @return + */ + public List<MQuality> listQuality(String companyId, String depotId, Date startTime, Date endTime) { + String hql = " from " + MQuality.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - if(null != startTime){ - hql += " and time >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and time <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and time >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and time <:endTime"; + args.put("endTime", endTime); + } - hql += " order by time desc"; + hql += " order by time desc"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 璇㈣川妫�鏄庣粏鏁版嵁----鎺ュ彛1202浣跨敤 - * @param checkId - * @return - */ - public List<CheckItem> listQualityDetail(String checkId) { + /** + * 璇㈣川妫�鏄庣粏鏁版嵁----鎺ュ彛1202浣跨敤 + * + * @param checkId + * @return + */ + public List<CheckItem> listQualityDetail(String checkId) { - String hql = " from " + CheckItem.class.getName() + " where checkId =:checkId"; + String hql = " from " + CheckItem.class.getName() + " where checkId =:checkId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("checkId", checkId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("checkId", checkId); - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ鍊掍粨淇℃伅鏁版嵁----鎺ュ彛1309浣跨敤 - * @param companyId - * @param depotId - * @param startTime - * @param endTime - * @return - */ - public List<MStockChange> listStockChange(String companyId, String depotId, Date startTime, Date endTime) { - String hql = " from " + MStockChange.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ鍊掍粨淇℃伅鏁版嵁----鎺ュ彛1309浣跨敤 + * + * @param companyId + * @param depotId + * @param startTime + * @param endTime + * @return + */ + public List<InoutStockChange> listStockChange(String companyId, String depotId, Date startTime, Date endTime) { + String hql = " from " + InoutStockChange.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - if(null != startTime){ - hql += " and updateTime >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and updateTime <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and updateTime >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and updateTime <:endTime"; + args.put("endTime", endTime); + } - hql += " order by updateTime desc"; + hql += " order by updateTime desc"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ鎹熸孩鍗曟暟鎹�----鎺ュ彛1311浣跨敤 - * @param companyId - * @param depotId - * @param startTime - * @param endTime - * @return - */ - public List<MLossOver> listLossOver(String companyId, String depotId, Date startTime, Date endTime) { - String hql = " from " + MLossOver.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ鎹熸孩鍗曟暟鎹�----鎺ュ彛1311浣跨敤 + * + * @param companyId + * @param depotId + * @param startTime + * @param endTime + * @return + */ + public List<InoutLossOver> listLossOver(String companyId, String depotId, Date startTime, Date endTime) { + String hql = " from " + InoutLossOver.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - if(null != startTime){ - hql += " and submitTime >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and submitTime <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and submitTime >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and submitTime <:endTime"; + args.put("endTime", endTime); + } - hql += " order by submitTime"; + hql += " order by submitTime"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ绮鎬ц川鍙樻洿淇℃伅----鎺ュ彛1312浣跨敤 - * @param companyId - * @param depotId - * @param startTime - * @param endTime - * @return - */ - public List<MVarietyChange> listFoodVarietyChange(String companyId, String depotId, Date startTime, Date endTime) { - String hql = " from " + MVarietyChange.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ绮鎬ц川鍙樻洿淇℃伅----鎺ュ彛1312浣跨敤 + * + * @param companyId + * @param depotId + * @param startTime + * @param endTime + * @return + */ + public List<InoutVarietyChange> listFoodVarietyChange(String companyId, String depotId, Date startTime, Date endTime) { + String hql = " from " + InoutVarietyChange.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - if(null != startTime){ - hql += " and changeTime >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and changeTime <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and changeTime >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and changeTime <:endTime"; + args.put("endTime", endTime); + } - hql += " order by changeTime"; + hql += " order by changeTime"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ娓╂箍搴︿俊鎭�----鎺ュ彛1401浣跨敤 - * @param companyId - * @param depotId - * @param startTime - * @param endTime - * @return - */ - public List<Grain> listGrain(String companyId, String depotId, Date startTime, Date endTime) { - String hql = " from " + Grain.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ娓╂箍搴︿俊鎭�----鎺ュ彛1401浣跨敤 + * + * @param companyId + * @param depotId + * @param startTime + * @param endTime + * @return + */ + public List<Grain> listGrain(String companyId, String depotId, Date startTime, Date endTime) { + String hql = " from " + Grain.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - if(null != startTime){ - hql += " and receiveDate >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and receiveDate <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and receiveDate >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and receiveDate <:endTime"; + args.put("endTime", endTime); + } - hql += " order by receiveDate"; + hql += " order by receiveDate"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ绮儏閰嶇疆淇℃伅----鎺ュ彛1402浣跨敤 - * @param companyId - * @param depotId - * @return - */ - public List<DepotConf> listDepotConf(String companyId, String depotId) { - String hql = " from " + DepotConf.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ绮儏閰嶇疆淇℃伅----鎺ュ彛1402浣跨敤 + * + * @param companyId + * @param depotId + * @return + */ + public List<DepotConf> listDepotConf(String companyId, String depotId) { + String hql = " from " + DepotConf.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - hql += " order by depotId"; + hql += " order by depotId"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ閫氶淇℃伅----鎺ュ彛1403浣跨敤 - * @param companyId - * @param depotId - * @param startTime - * @param endTime - * @return - */ - public List<MAreationData> listAreationData(String companyId, String depotId, Date startTime, Date endTime) { - String hql = " from " + MAreationData.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ閫氶淇℃伅----鎺ュ彛1403浣跨敤 + * + * @param companyId + * @param depotId + * @param startTime + * @param endTime + * @return + */ + public List<MAreationData> listAreationData(String companyId, String depotId, Date startTime, Date endTime) { + String hql = " from " + MAreationData.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - if(null != startTime){ - hql += " and updateTime >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and updateTime <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and updateTime >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and updateTime <:endTime"; + args.put("endTime", endTime); + } - hql += " order by updateTime"; + hql += " order by updateTime"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ鐔忚捀淇℃伅----鎺ュ彛1404浣跨敤 - * @param companyId - * @param depotId - * @param startTime - * @param endTime - * @return - */ - public List<DrugLog> listDrugLog(String companyId, String depotId, Date startTime, Date endTime) { - String hql = " from " + DrugLog.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ鐔忚捀淇℃伅----鎺ュ彛1404浣跨敤 + * + * @param companyId + * @param depotId + * @param startTime + * @param endTime + * @return + */ + public List<DrugLog> listDrugLog(String companyId, String depotId, Date startTime, Date endTime) { + String hql = " from " + DrugLog.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - if(null != startTime){ - hql += " and updateTime >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and updateTime <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and updateTime >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and updateTime <:endTime"; + args.put("endTime", endTime); + } - hql += " order by updateTime"; + hql += " order by updateTime"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ铏淇℃伅----鎺ュ彛1405浣跨敤 - * @param companyId - * @param depotId - * @param startTime - * @param endTime - * @return - */ - public List<Pest> listPest(String companyId, String depotId, Date startTime, Date endTime) { - String hql = " from " + Pest.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ铏淇℃伅----鎺ュ彛1405浣跨敤 + * + * @param companyId + * @param depotId + * @param startTime + * @param endTime + * @return + */ + public List<Pest> listPest(String companyId, String depotId, Date startTime, Date endTime) { + String hql = " from " + Pest.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - if(null != startTime){ - hql += " and receiveDate >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and receiveDate <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and receiveDate >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and receiveDate <:endTime"; + args.put("endTime", endTime); + } - hql += " order by receiveDate"; + hql += " order by receiveDate"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ铏淇℃伅----鎺ュ彛1408浣跨敤 - * @param companyId - * @param depotId - * @param startTime - * @param endTime - * @return - */ - public List<Gas> listGas(String companyId, String depotId, Date startTime, Date endTime) { - String hql = " from " + Gas.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ铏淇℃伅----鎺ュ彛1408浣跨敤 + * + * @param companyId + * @param depotId + * @param startTime + * @param endTime + * @return + */ + public List<Gas> listGas(String companyId, String depotId, Date startTime, Date endTime) { + String hql = " from " + Gas.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(depotId)){ - hql += " and depotId =:depotId"; - args.put("depotId", depotId); - } + if (StringUtils.isNotEmpty(depotId)) { + hql += " and depotId =:depotId"; + args.put("depotId", depotId); + } - if(null != startTime){ - hql += " and receiveDate >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and receiveDate <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and receiveDate >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and receiveDate <:endTime"; + args.put("endTime", endTime); + } - hql += " order by receiveDate"; + hql += " order by receiveDate"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ杞崲璁″垝淇℃伅----鎺ュ彛1501浣跨敤 - * @param companyId - * @param type - * @param startTime - * @param endTime - * @return - */ - public List<InoutPlan> listPlan(String companyId, String type, Date startTime, Date endTime) { - String hql = " from " + InoutPlan.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ杞崲璁″垝淇℃伅----鎺ュ彛1501浣跨敤 + * + * @param companyId + * @param type + * @param startTime + * @param endTime + * @return + */ + public List<InoutPlan> listPlan(String companyId, String type, Date startTime, Date endTime) { + String hql = " from " + InoutPlan.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(StringUtils.isNotEmpty(type)){ - hql += " and type =:type"; - args.put("type", type); - } + if (StringUtils.isNotEmpty(type)) { + hql += " and type =:type"; + args.put("type", type); + } - if(null != startTime){ - hql += " and createTime >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and createTime <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and createTime >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and createTime <:endTime"; + args.put("endTime", endTime); + } - hql += " order by createTime"; + hql += " order by createTime"; - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ杞崲鏄庣粏璁″垝淇℃伅----鎺ュ彛1502浣跨敤 - * @param planId - * @return - */ - public List<InoutPlanDetail> getPlanDetail(String planId) { + /** + * 鏌ヨ杞崲鏄庣粏璁″垝淇℃伅----鎺ュ彛1502浣跨敤 + * + * @param planId + * @return + */ + public List<InoutPlanDetail> getPlanDetail(String planId) { - String hql = " from " + InoutPlanDetail.class.getName() + " where planId =:planId"; + String hql = " from " + InoutPlanDetail.class.getName() + " where planId =:planId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("planId", planId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("planId", planId); - return this.query(hql, args); - } + return this.query(hql, args); + } - /** - * 鏌ヨ鍚堝悓淇℃伅----鎺ュ彛1503浣跨敤 - * @param companyId - * @param startTime - * @param endTime - * @return - */ - public List<MContract> listContract(String companyId, Date startTime, Date endTime){ - String hql = " from " + MContract.class.getName() + " where companyId =:companyId"; + /** + * 鏌ヨ鍚堝悓淇℃伅----鎺ュ彛1503浣跨敤 + * + * @param companyId + * @param startTime + * @param endTime + * @return + */ + public List<InoutContract> listContract(String companyId, Date startTime, Date endTime) { + String hql = " from " + InoutContract.class.getName() + " where companyId =:companyId"; - Map<String, Object> args = new HashMap<String, Object>(); - args.put("companyId", companyId); + Map<String, Object> args = new HashMap<String, Object>(); + args.put("companyId", companyId); - if(null != startTime){ - hql += " and createTime >:startTime"; - args.put("startTime", startTime); - } - if(null != endTime){ - hql += " and createTime <:endTime"; - args.put("endTime", endTime); - } + if (null != startTime) { + hql += " and createTime >:startTime"; + args.put("startTime", startTime); + } + if (null != endTime) { + hql += " and createTime <:endTime"; + args.put("endTime", endTime); + } - hql += " order by createTime"; + hql += " order by createTime"; - return this.query(hql, args); - } + return this.query(hql, args); + } } \ No newline at end of file -- Gitblit v1.9.3