Commit d89297fd authored by dahai's avatar dahai

修改查询膜、卡体统计报表

parent 6782a3e0
......@@ -120,7 +120,7 @@ public class MaterialManagementApi {
/**
* 查询未审核膜详情
*/
@RequestMapping("selectPlasticFilm")
@RequestMapping("selectPlasticFilm")
public List<PlasticFilmEntity> selectPlasticFilm(@Param("date")String date,@Param("name")String name){
return materialManagementService.selectPlasticFilm(replaceDate(date),name);
......
......@@ -131,8 +131,10 @@ public interface MaterialManagementMapper {
public boolean updatePlasticFilmState(long id);
@Select("<script>" +
"select * from (select name,save_date,CARD_BODY_TYPE,sum(count1) count1 ,sum(count2) count2,rownum rn\n" +
"from (select name,CARD_TYPE,CARD_BODY_TYPE,to_Char(SAVE_DATE,'yyyyMMdd') save_date, decode(card_type,2,0,total_count) count1 ,decode(card_type,1,0,total_count) count2 from CARD_BODY where (to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}) and state =1 " +
"select * from (SELECT ROWNUM rn,a.* FROM(select name,save_date,CARD_BODY_TYPE,sum(count1) count1 ,sum(count2) count2 from (\n" +
"select name,CARD_TYPE,CARD_BODY_TYPE,to_Char(SAVE_DATE,'yyyyMMdd') save_date, \n" +
" decode(card_type,2,0,total_count) count1 ,decode(card_type,1,0,total_count) count2 \n" +
" from CARD_BODY where (to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}) and state =1 " +
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
......@@ -142,14 +144,13 @@ public interface MaterialManagementMapper {
"<if test='cardBodyType != 0 '>" +
" and card_Body_Type =#{cardBodyType} " +
"</if>" +
"ORDER BY save_date) \n" +
" group by name, save_date,CARD_BODY_TYPE,rownum ORDER BY save_date,rownum) where rn BETWEEN #{start} and #{end}" +
"ORDER BY save_date)\n" +
" group by name, save_date, CARD_BODY_TYPE order by SAVE_DATE) a ) where rn BETWEEN #{start} and #{end} " +
"</script>")
public List<Map<String,Object>> selectCardBodyReport(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name, @Param("cardBodyType") long cardBodyType,@Param("start") long start,@Param("end") long end);
@Select("<script>" +
"select * from (select name,save_date,CARD_BODY_TYPE,sum(count1) count1 ,sum(count2) count2,rownum rn\n" +
"from (select name,CARD_TYPE,CARD_BODY_TYPE,to_Char(SAVE_DATE,'yyyyMMdd') save_date, decode(card_type,2,0,total_count) count1 ,decode(card_type,1,0,total_count) count2 from CARD_BODY where (to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}) and state =1 " +
"SELECT ROWNUM rn,a.* FROM(select name,save_date,CARD_BODY_TYPE,sum(count1) count1 ,sum(count2) count2 from ( select name,CARD_TYPE,CARD_BODY_TYPE,to_Char(SAVE_DATE,'yyyyMMdd') save_date, decode(card_type,2,0,total_count) count1 ,decode(card_type,1,0,total_count) count2 from CARD_BODY where (to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}) and state =1 " +
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
......@@ -159,8 +160,7 @@ public interface MaterialManagementMapper {
"<if test='cardBodyType != 0 '>" +
" and card_Body_Type =#{cardBodyType} " +
"</if>" +
"ORDER BY save_date) \n" +
" group by name, save_date,CARD_BODY_TYPE,rownum ORDER BY save_date,rownum) " +
"ORDER BY save_date) group by name, save_date, CARD_BODY_TYPE order by SAVE_DATE) a " +
"</script>")
public List<Map<String,Object>> selectCardBodyReportCount(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name, @Param("cardBodyType") long cardBodyType);
......@@ -170,30 +170,36 @@ public interface MaterialManagementMapper {
public List<Map<String,Object>> selectCardBodyReportTotalCount();
@Select("<script>" +
"select * from (select name,save_date,sum(count1) count1 ,sum(count2) count2,rownum rn\n" +
"from (select name,PLASTIC_FILM_TYPE,to_Char(SAVE_DATE,'yyyyMMdd') save_date, decode(PLASTIC_FILM_TYPE,2,0,total_count) count1 ,decode(PLASTIC_FILM_TYPE,1,0,total_count) count2 from PLASTIC_FILM where (to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}) and state =1 " +
"select * from (\n" +
" SELECT ROWNUM rn,a.* FROM(\n" +
" select name,save_date,sum(count1) count1 ,sum(count2) count2 \n" +
" from ( \n" +
" select name,to_Char(SAVE_DATE,'yyyyMMdd') save_date, \n" +
" decode(PLASTIC_FILM_TYPE,2,0,total_count) count1 ,decode(PLASTIC_FILM_TYPE,1,0,total_count) count2 \n" +
" from PLASTIC_FILM where (to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}) and state =1 " +
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
"<if test='typeCode != 0 '>" +
" and PLASTIC_FILM_TYPE =#{typeCode} " +
"</if>" +
"ORDER BY save_date) \n" +
" group by name, save_date,rownum ORDER BY save_date,rownum) where rn BETWEEN #{start} and #{end}" +
"ORDER BY save_date) group by name, save_date order by SAVE_DATE) a ) where rn BETWEEN #{start} and #{end}" +
"</script>")
public List<Map<String,Object>> selectPlasticFilmReport(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name,@Param("start") long start,@Param("end") long end);
@Select("<script>" +
"select * from (select name,save_date,sum(count1) count1 ,sum(count2) count2,rownum rn\n" +
"from (select name,PLASTIC_FILM_TYPE,to_Char(SAVE_DATE,'yyyyMMdd') save_date, decode(PLASTIC_FILM_TYPE,2,0,total_count) count1 ,decode(PLASTIC_FILM_TYPE,1,0,total_count) count2 from PLASTIC_FILM where (to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}) and state =1 " +
"SELECT ROWNUM rn,a.* FROM(\n" +
" select name,save_date,sum(count1) count1 ,sum(count2) count2 from ( \n" +
" select name,to_Char(SAVE_DATE,'yyyyMMdd') save_date,\n" +
" decode(PLASTIC_FILM_TYPE,2,0,total_count) count1 ,decode(PLASTIC_FILM_TYPE,1,0,total_count) count2 \n" +
" from PLASTIC_FILM where (to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}) and state =1 " +
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
"<if test='typeCode != 0 '>" +
" and PLASTIC_FILM_TYPE =#{typeCode} " +
"</if>" +
" ORDER BY save_date) \n" +
" group by name, save_date,rownum ORDER BY save_date,rownum)" +
" ORDER BY save_date) group by name, save_date order by SAVE_DATE) a " +
"</script>")
public List<Map<String,Object>> selectPlasticFilmReportCount(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name);
......
......@@ -99,7 +99,7 @@
<tbody>
<tr ng-repeat="item in plasticFilmdata.plasticFilm">
<td>{{item.plasticFilmId}}</td>
<td>{{item.saveDate}}</td>
<td>{{item.saveDate | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{item.totalCount}}</td>
<td ng-if="item.plasticFilmType==1">出库</td>
<td ng-if="item.plasticFilmType==2">入库</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment