Commit 895a29468201bd1084c33c2ff016cd5bdc1e5dff

Authored by 娄高锋
1 parent 10d26d62

十三张报表分公司多选的补充

src/main/java/com/bsth/repository/calc/CalcWaybillRepository.java
@@ -129,13 +129,17 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ @@ -129,13 +129,17 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ
129 129
130 //所有的加油,包含没有路单的 130 //所有的加油,包含没有路单的
131 @Query(value="select DISTINCT y from Ylb y left join CalcWaybill c on y.rq = c.rq and y.xlbm = c.xl and y.jsy = c.jGh and y.nbbm = c.cl " + 131 @Query(value="select DISTINCT y from Ylb y left join CalcWaybill c on y.rq = c.rq and y.xlbm = c.xl and y.jsy = c.jGh and y.nbbm = c.cl " +
132 - "where y.rq >= ?1 and y.rq <= ?2 and y.ssgsdm in(?3) and y.fgsdm in(?4) " +  
133 - "and y.xlbm in (select l.lineCode from Line l where l.nature in (?5) and l.lineCode in (?6)) order by y.rq desc") //按日期倒序,方便插入list  
134 - List<Ylb> ylb(Date date, Date date2, List<String> gsdm, List<String> fgsdm, List<String> nature, List<String> line); 132 + "where y.rq >= :date and y.rq <= :date2 and y.ssgsdm in(:gsdm) and (:fgsdmStr = '' OR y.fgsdm IN :fgsdms) " +
  133 + "and y.xlbm in (select l.lineCode from Line l where l.nature in (:nature) and l.lineCode in (:line)) order by y.rq desc") //按日期倒序,方便插入list
  134 + List<Ylb> ylb(@Param("date") Date date,@Param("date2") Date date2,
  135 + @Param("gsdm") List<String> gsdm,@Param("fgsdmStr") String fgsdmStr,@Param("fgsdms") List<String> fgsdms,
  136 + @Param("nature") List<String> nature,@Param("line") List<String> line);
135 137
136 //所有的加电,包含没有路单的 138 //所有的加电,包含没有路单的
137 @Query(value="select DISTINCT d from Dlb d left join CalcWaybill c on d.rq = c.rq and d.xlbm = c.xl and d.jsy = c.jGh and d.nbbm = c.cl " + 139 @Query(value="select DISTINCT d from Dlb d left join CalcWaybill c on d.rq = c.rq and d.xlbm = c.xl and d.jsy = c.jGh and d.nbbm = c.cl " +
138 - "where d.rq >= ?1 and d.rq <= ?2 and d.ssgsdm in(?3) and d.fgsdm in(?4) " +  
139 - "and d.xlbm in (select l.lineCode from Line l where l.nature in (?5) and l.lineCode in (?6)) order by d.rq desc") //按日期倒序,方便插入list  
140 - List<Dlb> dlb(Date date, Date date2, List<String> gsdm, List<String> fgsdm, List<String> nature, List<String> line); 140 + "where d.rq >= :date and d.rq <= :date2 and d.ssgsdm in(:gsdm) and (:fgsdmStr = '' OR d.fgsdm IN :fgsdms) " +
  141 + "and d.xlbm in (select l.lineCode from Line l where l.nature in (:nature) and l.lineCode in (:line)) order by d.rq desc") //按日期倒序,方便插入list
  142 + List<Dlb> dlb(@Param("date") Date date,@Param("date2") Date date2,
  143 + @Param("gsdm") List<String> gsdm,@Param("fgsdmStr") String fgsdmStr,@Param("fgsdms") List<String> fgsdms,
  144 + @Param("nature") List<String> nature,@Param("line") List<String> line);
141 } 145 }
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
@@ -2939,8 +2939,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -2939,8 +2939,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
2939 2939
2940 if(flag != 2){ 2940 if(flag != 2){
2941 try { 2941 try {
2942 - List<Ylb> ylb = calcRepository.ylb(dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdms, nature, line);  
2943 - List<Dlb> dlb = calcRepository.dlb(dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdms, nature, line); 2942 + List<Ylb> ylb = calcRepository.ylb(dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdmStr, fgsdms, nature, line);
  2943 + List<Dlb> dlb = calcRepository.dlb(dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdmStr, fgsdms, nature, line);
2944 2944
2945 for(Ylb y : ylb){ 2945 for(Ylb y : ylb){
2946 String key = y.getSsgsdm() + "_" + y.getFgsdm() + "_" + y.getXlbm(); 2946 String key = y.getSsgsdm() + "_" + y.getFgsdm() + "_" + y.getXlbm();