Commit f8bbc62e authored by dahai's avatar dahai

添加数据统计

parent ee4a2d58
......@@ -26,8 +26,8 @@ public class MaterialManagementApi {
* @return
*/
@RequestMapping("insertFilm")
public boolean insertFilm(@Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note){
boolean result = materialManagementService.insertFilm(totalCount, plasticFilmType, note);
public boolean insertFilm(@Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note, @Param("name")String name){
boolean result = materialManagementService.insertFilm(totalCount, plasticFilmType, note,name);
return result;
}
......@@ -39,29 +39,68 @@ public class MaterialManagementApi {
* @return
*/
@RequestMapping("insertCardBody")
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note){
boolean result = materialManagementService.insertCardBody(cardType, totalCount, note);
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note, @Param("name")String name){
boolean result = materialManagementService.insertCardBody(cardType, totalCount, note,name);
return result;
}
// /**
// * 查询耗材统计数据
// * @param beginDate
// * @param endDate
// * @return
// */
// @RequestMapping("selectMaterialManagement")
// public Map<String,Object> selectMaterialManagement(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name){
// Map<String,Object> resultMap = new HashMap<>();
// List<CardBodyEntity> cardBodyEntities = materialManagementService.selectCardBody(replaceDate(beginDate),replaceDate(endDate));
// List<PlasticFilmEntity> plasticFilmEntities = materialManagementService.selectFilm(replaceDate(beginDate),replaceDate(endDate));
// String cardCount1 = materialManagementService.selectCardCount1(beginDate,endDate);
// String cardCount2 = materialManagementService.selectCardCount2(beginDate,endDate);
// String plasticFilmCount1=materialManagementService.selectFilmCount1(beginDate,endDate);
// String plasticFilmCount2=materialManagementService.selectFilmCount2(beginDate,endDate);
// resultMap.put("cardBody",cardBodyEntities);
// resultMap.put("cardCount1",cardCount1);
// resultMap.put("cardCount2",cardCount2);
// resultMap.put("plasticFilm",plasticFilmEntities);
// resultMap.put("plasticFilmCount1",plasticFilmCount1);
// resultMap.put("plasticFilmCount2",plasticFilmCount2);
// return resultMap;
//
// }
/**
* 查询耗材统计数据
* 查询卡机统计数据
* @param beginDate
* @param endDate
* @return
*/
@RequestMapping("selectMaterialManagement")
public Map<String,Object> selectMaterialManagement(@Param("beginDate")String beginDate,@Param("endDate")String endDate){
@RequestMapping("selectCardBodyManagement")
public Map<String,Object> selectCardBodyManagement(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name){
Map<String,Object> resultMap = new HashMap<>();
List<CardBodyEntity> cardBodyEntities = materialManagementService.selectCardBody(replaceDate(beginDate),replaceDate(endDate));
List<PlasticFilmEntity> plasticFilmEntities = materialManagementService.selectFilm(replaceDate(beginDate),replaceDate(endDate));
String cardCount1 = materialManagementService.selectCardCount1(beginDate,endDate);
String cardCount2 = materialManagementService.selectCardCount2(beginDate,endDate);
String plasticFilmCount1=materialManagementService.selectFilmCount1(beginDate,endDate);
String plasticFilmCount2=materialManagementService.selectFilmCount2(beginDate,endDate);
List<CardBodyEntity> cardBodyEntities = materialManagementService.selectCardBody(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
String cardCount1 = materialManagementService.selectCardCount1(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
String cardCount2 = materialManagementService.selectCardCount2(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
resultMap.put("cardBody",cardBodyEntities);
resultMap.put("cardCount1",cardCount1);
resultMap.put("cardCount2",cardCount2);
return resultMap;
}
/**
* 查询膜统计数据
* @param beginDate
* @param endDate
* @return
*/
@RequestMapping("selectPlasticFilmManagement")
public Map<String,Object> selectPlasticFilmManagement(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name){
Map<String,Object> resultMap = new HashMap<>();
List<PlasticFilmEntity> plasticFilmEntities = materialManagementService.selectFilm(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
String plasticFilmCount1=materialManagementService.selectFilmCount1(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
String plasticFilmCount2=materialManagementService.selectFilmCount2(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
resultMap.put("plasticFilm",plasticFilmEntities);
resultMap.put("plasticFilmCount1",plasticFilmCount1);
resultMap.put("plasticFilmCount2",plasticFilmCount2);
......@@ -69,6 +108,9 @@ public class MaterialManagementApi {
}
/**
* 去除字符串中中线
* @param str
......
......@@ -2,17 +2,21 @@ package com.yxproject.start.entity;
import javax.persistence.*;
import java.sql.Time;
import java.util.Date;
import java.util.Objects;
/**
* @auther zhangyusheng
* 2019/4/1 15:03
*/
@Entity
@Table(name = "CARD_BODY", schema = "YINGXIN", catalog = "")
public class CardBodyEntity {
private long cardBodyId;
private Date saveDate;
private Time saveDate;
private Long cardType;
private Long totalCount;
private String note;
private String name;
@Id
@Column(name = "CARD_BODY_ID")
......@@ -26,11 +30,11 @@ public class CardBodyEntity {
@Basic
@Column(name = "SAVE_DATE")
public Date getSaveDate() {
public Time getSaveDate() {
return saveDate;
}
public void setSaveDate(Date saveDate) {
public void setSaveDate(Time saveDate) {
this.saveDate = saveDate;
}
......@@ -64,6 +68,16 @@ public class CardBodyEntity {
this.note = note;
}
@Basic
@Column(name = "NAME")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
......@@ -73,11 +87,12 @@ public class CardBodyEntity {
Objects.equals(saveDate, that.saveDate) &&
Objects.equals(cardType, that.cardType) &&
Objects.equals(totalCount, that.totalCount) &&
Objects.equals(note, that.note);
Objects.equals(note, that.note) &&
Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(cardBodyId, saveDate, cardType, totalCount, note);
return Objects.hash(cardBodyId, saveDate, cardType, totalCount, note, name);
}
}
......@@ -2,17 +2,21 @@ package com.yxproject.start.entity;
import javax.persistence.*;
import java.sql.Time;
import java.util.Date;
import java.util.Objects;
/**
* @auther zhangyusheng
* 2019/4/1 15:04
*/
@Entity
@Table(name = "PLASTIC_FILM", schema = "YINGXIN", catalog = "")
public class PlasticFilmEntity {
private long plasticFilmId;
private Date saveDate;
private Time saveDate;
private Long totalCount;
private Long plasticFilmType;
private String note;
private String name;
@Id
@Column(name = "PLASTIC_FILM_ID")
......@@ -26,11 +30,11 @@ public class PlasticFilmEntity {
@Basic
@Column(name = "SAVE_DATE")
public Date getSaveDate() {
public Time getSaveDate() {
return saveDate;
}
public void setSaveDate(Date saveDate) {
public void setSaveDate(Time saveDate) {
this.saveDate = saveDate;
}
......@@ -64,6 +68,16 @@ public class PlasticFilmEntity {
this.note = note;
}
@Basic
@Column(name = "NAME")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
......@@ -73,11 +87,12 @@ public class PlasticFilmEntity {
Objects.equals(saveDate, that.saveDate) &&
Objects.equals(totalCount, that.totalCount) &&
Objects.equals(plasticFilmType, that.plasticFilmType) &&
Objects.equals(note, that.note);
Objects.equals(note, that.note) &&
Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(plasticFilmId, saveDate, totalCount, plasticFilmType, note);
return Objects.hash(plasticFilmId, saveDate, totalCount, plasticFilmType, note, name);
}
}
......@@ -13,30 +13,78 @@ import java.util.Map;
@Mapper
public interface MaterialManagementMapper {
@Insert("INSERT INTO PLASTIC_FILM (TOTAL_COUNT,PLASTIC_FILM_TYPE,NOTE)VALUES(#{totalCount},#{plasticFilmType},#{note})")
public boolean insertFilm(@Param("totalCount")String totalCount,@Param("plasticFilmType")String plasticFilmType,@Param("note")String note);
@Insert("INSERT INTO PLASTIC_FILM (TOTAL_COUNT,PLASTIC_FILM_TYPE,NOTE,name)VALUES(#{totalCount},#{plasticFilmType},#{note},#{name})")
public boolean insertFilm(@Param("totalCount")String totalCount,@Param("plasticFilmType")String plasticFilmType,@Param("note")String note,@Param("name")String name);
@Select("select * from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}")
public List<PlasticFilmEntity> selectFilm(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
@Select("<script>" +
"select * from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}" +
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
"<if test='typeCode != 0 '>" +
" and typeCode =#{typeCode} " +
"</if>" +
"</script>")
public List<PlasticFilmEntity> selectFilm(@Param("beginDate") String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name);
@Select("select sum(TOTAL_COUNT) PLASTIC_FILM_TYPE1 from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and PLASTIC_FILM_TYPE=1 ")
public String selectFilmCount1(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
@Select("<script>" +
"select sum(TOTAL_COUNT) PLASTIC_FILM_TYPE1 from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and PLASTIC_FILM_TYPE=1 "+
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
"<if test='typeCode != 0 '>" +
" and typeCode =#{typeCode} " +
"</if>" +
"</script>")
public String selectFilmCount1(@Param("beginDate") String beginDate,@Param("endDate")String endDate ,@Param("typeCode")String typeCode,@Param("name")String name);
@Select("select sum(TOTAL_COUNT) PLASTIC_FILM_TYPE1 from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and PLASTIC_FILM_TYPE=2")
public String selectFilmCount2(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
@Select("<script>" +
"select sum(TOTAL_COUNT) PLASTIC_FILM_TYPE1 from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and PLASTIC_FILM_TYPE=2"+
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
"<if test='typeCode != 0 '>" +
" and typeCode =#{typeCode} " +
"</if>" +
"</script>")
public String selectFilmCount2(@Param("beginDate") String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name);
@Insert("INSERT INTO CARD_BODY (CARD_TYPE,TOTAL_COUNT,NOTE)VALUES(#{cardType},#{totalCount},#{note})")
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note);
@Insert("INSERT INTO CARD_BODY (CARD_TYPE,TOTAL_COUNT,NOTE,name)VALUES(#{cardType},#{totalCount},#{note},#{name})")
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note,@Param("name")String name);
@Select("select * from CARD_BODY where to_char(SAVE_DATE,'yyyyMMdd') between #{beginDate} and #{endDate}")
public List<CardBodyEntity> selectCardBody(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
@Select("<script>" +
"select * from CARD_BODY where to_char(SAVE_DATE,'yyyyMMdd') between #{beginDate} and #{endDate}"+
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
"<if test='typeCode != 0 '>" +
" and typeCode =#{typeCode} " +
"</if>" +
"</script>")
public List<CardBodyEntity> selectCardBody(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name);
@Select("select sum(TOTAL_COUNT) cardType1 from CARD_BODY where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and CARD_TYPE=1")
public String selectCardCount1(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
@Select("<script>" +
"select sum(TOTAL_COUNT) cardType1 from CARD_BODY where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and CARD_TYPE=1"+
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
"<if test='typeCode != 0 '>" +
" and typeCode =#{typeCode} " +
"</if>" +
"</script>")
public String selectCardCount1(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name);
@Select("select sum(TOTAL_COUNT) cardType2 from CARD_BODY where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and CARD_TYPE=2")
public String selectCardCount2(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
@Select("<script>" +
"select sum(TOTAL_COUNT) cardType2 from CARD_BODY where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and CARD_TYPE=2"+
"<if test='name != null '>" +
" and name =#{name} " +
"</if>" +
"<if test='typeCode != 0 '>" +
" and typeCode =#{typeCode} " +
"</if>" +
"</script>")
public String selectCardCount2(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name);
}
......@@ -10,21 +10,21 @@ import java.util.Map;
public interface MaterialManagementService {
public boolean insertFilm( @Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note);
public boolean insertFilm( @Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note,String name);
public List<PlasticFilmEntity> selectFilm(@Param("beginDate") String beginDate, @Param("endDate")String endDate);
public List<PlasticFilmEntity> selectFilm(@Param("beginDate") String beginDate, @Param("endDate")String endDate,String typeCode, String name);
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note);
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note,String name);
public List<CardBodyEntity> selectCardBody(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
public List<CardBodyEntity> selectCardBody(@Param("beginDate")String beginDate, @Param("endDate")String endDate,String typeCode, String name);
public String selectFilmCount1(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
public String selectFilmCount1(@Param("beginDate") String beginDate,@Param("endDate")String endDate,String typeCode, String name);
public String selectFilmCount2(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
public String selectFilmCount2(@Param("beginDate") String beginDate,@Param("endDate")String endDate,String typeCode, String name);
public String selectCardCount1(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
public String selectCardCount1(@Param("beginDate")String beginDate,@Param("endDate")String endDate,String typeCode, String name);
public String selectCardCount2(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
public String selectCardCount2(@Param("beginDate")String beginDate,@Param("endDate")String endDate,String typeCode, String name);
}
......@@ -16,50 +16,50 @@ public class MaterialManagementServiceImpl implements MaterialManagementService
@Autowired
private MaterialManagementMapper materialManagementMapper;
@Override
public boolean insertFilm( String totalCount, String plasticFilmType, String note) {
materialManagementMapper.insertFilm(totalCount,plasticFilmType,note);
public boolean insertFilm( String totalCount, String plasticFilmType, String note,String name) {
materialManagementMapper.insertFilm(totalCount,plasticFilmType,note,name);
return true;
}
@Override
public List<PlasticFilmEntity> selectFilm(String beginDate, String endDate) {
List<PlasticFilmEntity> resultList = materialManagementMapper.selectFilm(beginDate, endDate);
public List<PlasticFilmEntity> selectFilm(String beginDate, String endDate,String typeCode, String name) {
List<PlasticFilmEntity> resultList = materialManagementMapper.selectFilm(beginDate, endDate,typeCode,name);
return resultList;
}
@Override
public boolean insertCardBody( String cardType, String totalCount, String note) {
materialManagementMapper.insertCardBody(cardType,totalCount,note);
public boolean insertCardBody( String cardType, String totalCount, String note,String name) {
materialManagementMapper.insertCardBody(cardType,totalCount,note,name);
return true;
}
@Override
public List<CardBodyEntity> selectCardBody(String beginDate, String endDate) {
List<CardBodyEntity> resultList = materialManagementMapper.selectCardBody(beginDate, endDate);
public List<CardBodyEntity> selectCardBody(String beginDate, String endDate,String typeCode, String name) {
List<CardBodyEntity> resultList = materialManagementMapper.selectCardBody(beginDate, endDate, typeCode, name);
return resultList;
}
@Override
public String selectFilmCount1(String beginDate, String endDate) {
String result = materialManagementMapper.selectFilmCount1(beginDate, endDate);
public String selectFilmCount1(String beginDate, String endDate,String typeCode, String name) {
String result = materialManagementMapper.selectFilmCount1(beginDate, endDate,typeCode,name);
return result;
}
@Override
public String selectFilmCount2(String beginDate, String endDate) {
String result = materialManagementMapper.selectFilmCount2(beginDate, endDate);
public String selectFilmCount2(String beginDate, String endDate,String typeCode, String name) {
String result = materialManagementMapper.selectFilmCount2(beginDate, endDate,typeCode,name);
return result;
}
@Override
public String selectCardCount1(String beginDate, String endDate) {
String result = materialManagementMapper.selectCardCount1(beginDate, endDate);
public String selectCardCount1(String beginDate, String endDate,String typeCode, String name) {
String result = materialManagementMapper.selectCardCount1(beginDate, endDate,typeCode,name);
return result;
}
@Override
public String selectCardCount2(String beginDate, String endDate) {
String result = materialManagementMapper.selectCardCount2(beginDate, endDate);
public String selectCardCount2(String beginDate, String endDate,String typeCode, String name) {
String result = materialManagementMapper.selectCardCount2(beginDate, endDate,typeCode,name);
return result;
}
......
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