|
|
@@ -9,6 +9,7 @@ import com.kingdee.bos.framework.ejb.EJBFactory;
|
|
|
import com.kingdee.bos.metadata.entity.*;
|
|
|
import com.kingdee.bos.metadata.query.util.CompareType;
|
|
|
import com.kingdee.bos.util.BOSUuid;
|
|
|
+import com.kingdee.eas.base.permission.util.ToolUtils;
|
|
|
import com.kingdee.eas.basedata.org.AdminOrgUnitInfo;
|
|
|
import com.kingdee.eas.basedata.org.HROrgUnitInfo;
|
|
|
import com.kingdee.eas.basedata.org.PositionInfo;
|
|
|
@@ -82,25 +83,22 @@ public class WaterElectricityListHandler extends WaterElectricityBatchListHandle
|
|
|
sel.append(" left join t_bd_person p on pp.FPERSONID = p.fid ");
|
|
|
sel.append(" left join T_HR_BDEmployeeType bt on bt.fid = p.FEmployeeTypeID ");
|
|
|
sel.append(" left join CT_DOR_Dormitory dy on ops.CFDormitoryID=dy.fid ");
|
|
|
- sel.append(" left join CT_WAT_WaterPowerPricing wpp on wpp.CFEndDate>='" + startPeriodDateStr + "' ");
|
|
|
+ sel.append(" left join CT_WAT_WaterPowerPricing wpp on wpp.CFEndDate >='" + startPeriodDateStr + "' ");
|
|
|
sel.append(" and wpp.CFStartDate<='" + endPeriodDateStr + "' ");
|
|
|
sel.append(" left join CT_MAN_WaterPowerMeterReading wpmr on wpmr.CFDormitoryID=ops.CFDormitoryID ");
|
|
|
- sel.append(" and wpmr.CFYears<=ops.CFCheckOutDate ");
|
|
|
- sel.append(" and DATEADD(DD,-1,DATEADD(MM,DATEDIFF(MM,0,wpmr.CFYears)+1,0))>= ops.CFCheckInDate ");
|
|
|
+// sel.append(" and wpmr.CFYears<=ops.CFCheckOutDate ");
|
|
|
+// sel.append(" and DATEADD(DD,-1,DATEADD(MM,DATEDIFF(MM,0,wpmr.CFYears)+1,0))>= ops.CFCheckInDate ");
|
|
|
+ sel.append(" and wpmr.CFYears >= '" + startPeriodDateStr + "' ");
|
|
|
+ sel.append(" and wpmr.CFYears <= '" + endPeriodDateStr + "' ");
|
|
|
+
|
|
|
sel.append(" left join CT_WOE_WaterElectricity wey on wey.FSourceFunction=ops.fid and wey.CFPersonID=pp.FPERSONID ");
|
|
|
sel.append(" and wey.CFStartDate='" + startPeriodDateStr + "' ");
|
|
|
- sel.append(" and wey.CFEndDate='" + endPeriodDateStr + "' ");
|
|
|
+ sel.append(" and wey.CFEndDate= '" + endPeriodDateStr + "' ");
|
|
|
sel.append(" where ");
|
|
|
sel.append(" to_char(ops.CFCheckOutDate,'yyyy-MM-dd') >= '" + startPeriodDateStr + "' ");
|
|
|
sel.append(" and to_char(ops.CFCheckInDate ,'yyyy-MM-dd') <='" + endPeriodDateStr + "' ");
|
|
|
- if (null != billids && (!billids.isEmpty())) {
|
|
|
- sel.append(" and wey.fid in('' ");
|
|
|
- for (String id : billids) {
|
|
|
- sel.append(",'");
|
|
|
- sel.append(id);
|
|
|
- sel.append("'");
|
|
|
- }
|
|
|
- sel.append(")");
|
|
|
+ if (null != billids && !billids.isEmpty()) {
|
|
|
+ sel.append(" and wey.fid in( " +ToolUtils.aryToStr(billids) + ")");
|
|
|
}
|
|
|
System.out.println("getPersonWaterElectricitySql:" + sel);
|
|
|
return sel;
|
|
|
@@ -239,12 +237,8 @@ public class WaterElectricityListHandler extends WaterElectricityBatchListHandle
|
|
|
sel.append(" AND CONVERT(varchar(10), ops.CFCheckInDate, 23) <= '").append(endPeriodDateStr).append("'");
|
|
|
|
|
|
// 账单ID筛选:若传入billids集合,追加IN条件(避免空集合报错)
|
|
|
- if (null != billids && (!billids.isEmpty())) {
|
|
|
- sel.append(" AND wey.fid IN ('') ");
|
|
|
- for (String id : billids) {
|
|
|
- sel.append(",'").append(id).append("'");
|
|
|
- }
|
|
|
- sel.append(")");
|
|
|
+ if (null != billids && !billids.isEmpty()) {
|
|
|
+ sel.append(" and wey.fid in( " +ToolUtils.aryToStr(billids) + ")");
|
|
|
}
|
|
|
|
|
|
// 递归深度限制:10层足够覆盖日常树形(房间→楼栋→小区→...),避免异常
|