Commit 7ce600d0 authored by Administrator's avatar Administrator

添加了CityList的实体,Service,Impl;

添加了County的实体,Service,Impl;
修改了CityList,County,TypeList的xml和mapper;
添加了ReceiptList的实体,Service,Impl,修改了下载交接单的sql
parent c19b02c0
......@@ -55,6 +55,8 @@ public class UserApi {
private CountyService countyService;
@Autowired
private TypeListService typeListService;
@Autowired
private ReceiptListService receiptListService;
// @Autowired
// private ReadCountyListXMLService readCountyListXMLService;
......@@ -373,39 +375,6 @@ public class UserApi {
return yxjsonResponse.toJSONString();
}
/**
* 通过状态查询组列表;
*
* @returns
*/
@RequestMapping("getGroupNoByTaskStateId")
// @RequiresPermissions("userInfo.add")//权限管理;
public String findGroupListByTaskStateId(@RequestParam("taskStateId") String taskStateId, HttpServletResponse resp) {
List<GroupListEntity> groupNoEntity = groupListService.findGroupListByTaskStateId(taskStateId);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(groupNoEntity);
Map map = new HashMap();
// map.put("MakeType",productionTaskListEntity);
return yxjsonResponse.toJSONString();
}
/**
* 通过制证类型查询组列表;
*
* @returns
*/
@RequestMapping("getGroupNoByCardType")
// @RequiresPermissions("userInfo.add")//权限管理;
public String getGroupListByCardType(@RequestParam("cardType") String cardType, HttpServletResponse resp) {
List<GroupListEntity> groupNoEntity = groupListService.findGroupListByCardType(cardType);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(groupNoEntity);
Map map = new HashMap();
// map.put("MakeType",productionTaskListEntity);
return yxjsonResponse.toJSONString();
}
/**
* 查询TypeList通过状态;
......@@ -599,13 +568,13 @@ public class UserApi {
*
* @return
*/
@RequestMapping("getConnectList")
@RequestMapping("getReceiptList")
// @RequiresPermissions("userInfo.add")//权限管理;
public String getConnectList(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, HttpServletResponse resp) {
List<CountyListEntity> countyListEntity = countyListService.getConnectList(startDate,endDate);
public String getReceiptList(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, HttpServletResponse resp) {
List<ReceiptListEntity> receiptListEntity = receiptListService.getReceiptList(startDate,endDate);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(countyListEntity);
yxjsonResponse.outPutSuccess(receiptListEntity);
Map map = new HashMap();
// map.put("MakeType",productionTaskListEntity);
return yxjsonResponse.toJSONString();
......@@ -654,9 +623,9 @@ public class UserApi {
// String dateTime = DateFormatUtils.format(new Date(), "yyyyMMddHH");
//// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
// String fout = null;
// List <CountyListEntity> countyListEntity = countyListService.getConnectList(startDate,endDate);
// fout = connectListExcel(countyListEntity, countyListEntity.get(0).getOut_Storage_Count() + "", 6000, countyListEntity.get(0).getCounty_Code(), dateTime, startDate, endDate);
// String outFile = dateTime + countyListEntity.get(0).getCounty_Code() + "二代身份证交接单";
// List<ReceiptListEntity> receiptListEntity = receiptListService.getReceiptList(startDate,endDate);
// fout = receiptListExcel(receiptListEntity, receiptListEntity.get(0).getXiaoJi() + "", 6000, receiptListEntity.get(0).getBoxCount(), dateTime, startDate, endDate);
// String outFile = dateTime + "二代身份证交接单";
// try {
// FileInputStream fis = new FileInputStream(new File(fout));
// byte[] b = new byte[fis.available()];
......@@ -675,12 +644,13 @@ public class UserApi {
// /**
// * 下载交接单
// *
// * @param countyListEntity 交接单信息
// * @param receiptListEntity 交接单信息
// * @param typeName 制证类型
// * @param sum 总数
// * @param countyCode 区县代码
// * @param boxCount 区县代码
// * @param countyName 区县名称
// */
// private String connectListExcel( List <CountyListEntity> countyListEntity, String typeName, int sum, String countyCode, String dateTime, String startDate ,String endDate) {
// private String receiptListExcel( List<ReceiptListEntity> receiptListEntity, String typeName, int sum, String boxCount, String dateTime, String startDate ,String endDate) {
// if (typeName.contains("null")) {
// typeName = typeName.replace("null", "");
// }
......@@ -749,23 +719,23 @@ public class UserApi {
// cell.setCellStyle(style);
//
// cell = row.createCell(2); //第三个单元格
// cell.setCellValue("快证");
// cell.setCellValue("快证");
// cell.setCellStyle(style);
//
// cell = row.createCell(3); //第四个单元格
// cell.setCellValue("KS普");
// cell.setCellValue("省内异地快速通道邮");
// cell.setCellStyle(style);
//
// cell = row.createCell(4); //第五个单元格
// cell.setCellValue("异地KS普");
// cell.setCellValue("省内异地快速通道普");
// cell.setCellStyle(style);
//
// cell = row.createCell(5); //第六个单元格
// cell.setCellValue("异地普");
// cell.setCellValue("省内异地邮");
// cell.setCellStyle(style);
//
// cell = row.createCell(6); //第七个单元格
// cell.setCellValue("全国证");
// cell.setCellValue("省内异地普");
// cell.setCellStyle(style);
//
// cell = row.createCell(7); //第八个单元格
......@@ -773,18 +743,22 @@ public class UserApi {
// cell.setCellStyle(style);
//
// cell = row.createCell(8); //第九个单元格
// cell.setCellValue("港澳");
// cell.setCellValue("快速通道普");
// cell.setCellStyle(style);
//
// cell = row.createCell(9); //第十个单元格
// cell.setCellValue("台湾");
// cell.setCellValue("快速通道邮");
// cell.setCellStyle(style);
//
// cell = row.createCell(10); //第十一个单元格
// cell.setCellValue("小计");
// cell.setCellValue("邮寄证");
// cell.setCellStyle(style);
//
// cell = row.createCell(11); //第十二个单元格
// cell.setCellValue("小计");
// cell.setCellStyle(style);
//
// cell = row.createCell(12); //第十三个单元格
// cell.setCellValue("盒数");
// cell.setCellStyle(style);
//
......
package com.yxproject.start.entity;
import javax.persistence.*;
import java.util.Date;
import java.util.Objects;
/**
* Created by Administrator on 2018/12/19.
*/
@Entity
@Table(name = "CITY_LIST", schema = "DAHAI")
public class CityListEntity {
private long taskId;
private long cardType;
private long oldCardType;
private String citycode;
private Date submitDate;
private Date issuedDate;
private long printState;
private Date downloadDate;
private Date printOutDate;
private Date positionDate;
private Date outWorkshopDate;
private String qualityPeopleName;
private Date qualityTestDate;
private String exceptionInformation;
private Date outStorageDate;
private Date inStorageDate;
private long taskStateId;
private long isException;
private long printerId;
private String cityName;
private long groupCount;
private long groupNo;
private long validCount;
private long invalidCount;
@Id
@Column(name = "taskId", nullable = false, precision = 0)
public long getTaskId() {
return taskId;
}
public void setTaskId(long taskId) {
this.taskId = taskId;
}
@Basic
@Column(name = "cardType", nullable = false, precision = 0)
public long getCardType() {
return cardType;
}
public void setCardType(long cardType) {
this.cardType = cardType;
}
@Basic
@Column(name = "oldCardType", nullable = false, precision = 0)
public long getOldCardType() {
return oldCardType;
}
public void setOldCardType(long oldCardType) {
this.oldCardType = oldCardType;
}
@Basic
@Column(name = "citycode", nullable = true, length = 20)
public String getCitycode() {
return citycode;
}
public void setCitycode(String citycode) {
this.citycode = citycode;
}
@Basic
@Column(name = "submitDate", nullable = true)
public Date getSubmitDate() {
return submitDate;
}
public void setSubmitDate(Date submitDate) {
this.submitDate = submitDate;
}
@Basic
@Column(name = "issuedDate", nullable = true)
public Date getIssuedDate() {
return issuedDate;
}
public void setIssuedDate(Date issuedDate) {
this.issuedDate = issuedDate;
}
@Basic
@Column(name = "printState", nullable = true, precision = 0)
public long getPrintState() {
return printState;
}
public void setPrintState(long printState) {
this.printState = printState;
}
@Basic
@Column(name = "downloadDate", nullable = true)
public Date getDownloadDate() {
return downloadDate;
}
public void setDownloadDate(Date downloadDate) {
this.downloadDate = downloadDate;
}
@Basic
@Column(name = "printOutDate", nullable = true)
public Date getPrintOutDate() {
return printOutDate;
}
public void setPrintOutDate(Date printOutDate) {
this.printOutDate = printOutDate;
}
@Basic
@Column(name = "positionDate", nullable = true)
public Date getPositionDate() {
return positionDate;
}
public void setPositionDate(Date positionDate) {
this.positionDate = positionDate;
}
@Basic
@Column(name = "outWorkshopDate", nullable = true)
public Date getOutWorkshopDate() {
return outWorkshopDate;
}
public void setOutWorkshopDate(Date outWorkshopDate) {
this.outWorkshopDate = outWorkshopDate;
}
@Basic
@Column(name = "qualityPeopleName", nullable = true, length = 20)
public String getQualityPeopleName() {
return qualityPeopleName;
}
public void setQualityPeopleName(String qualityPeopleName) {
this.qualityPeopleName = qualityPeopleName;
}
@Basic
@Column(name = "qualityTestDate", nullable = true)
public Date getQualityTestDate() {
return qualityTestDate;
}
public void setQualityTestDate(Date qualityTestDate) {
this.qualityTestDate = qualityTestDate;
}
@Basic
@Column(name = "exceptionInformation", nullable = true, length = 120)
public String getExceptionInformation() {
return exceptionInformation;
}
public void setExceptionInformation(String exceptionInformation) {
this.exceptionInformation = exceptionInformation;
}
@Basic
@Column(name = "outStorageDate", nullable = true)
public Date getOutStorageDate() {
return outStorageDate;
}
public void setOutStorageDate(Date outStorageDate) {
this.outStorageDate = outStorageDate;
}
@Basic
@Column(name = "inStorageDate", nullable = true)
public Date getInStorageDate() {
return inStorageDate;
}
public void setInStorageDate(Date inStorageDate) {
this.inStorageDate = inStorageDate;
}
@Basic
@Column(name = "taskStateId", nullable = true, precision = 0)
public long getTaskStateId() {
return taskStateId;
}
public void setTaskStateId(long taskStateId) {
this.taskStateId = taskStateId;
}
@Basic
@Column(name = "isException", nullable = true, precision = 0)
public long getIsException() {
return isException;
}
public void setIsException(long isException) {
this.isException = isException;
}
@Basic
@Column(name = "printerId", nullable = true, precision = 0)
public long getPrinterId() {
return printerId;
}
public void setPrinterId(long printerId) {
this.printerId = printerId;
}
@Basic
@Column(name = "cityName", nullable = true, length = 20)
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
@Basic
@Column(name = "groupCount", nullable = true, precision = 0)
public long getGroupCount() {
return groupCount;
}
public void setGroupCount(long groupCount) {
this.groupCount = groupCount;
}
@Basic
@Column(name = "groupNo", nullable = true, precision = 0)
public long getGroupNo() {
return groupNo;
}
public void setGroupNo(long groupNo) {
this.groupNo = groupNo;
}
@Basic
@Column(name = "validCount", nullable = true, precision = 0)
public long getValidCount() {
return validCount;
}
public void setValidCount(long validCount) {
this.validCount = validCount;
}
@Basic
@Column(name = "invalidCount", nullable = true, precision = 0)
public long getInvalidCount() {
return invalidCount;
}
public void setInvalidCount(long invalidCount) {
this.invalidCount = invalidCount;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CityListEntity that = (CityListEntity) o;
return taskId == that.taskId &&
cardType == that.cardType &&
oldCardType == that.oldCardType &&
Objects.equals(citycode, that.citycode) &&
Objects.equals(submitDate, that.submitDate) &&
Objects.equals(issuedDate, that.issuedDate) &&
Objects.equals(printState, that.printState) &&
Objects.equals(downloadDate, that.downloadDate) &&
Objects.equals(printOutDate, that.printOutDate) &&
Objects.equals(positionDate, that.positionDate) &&
Objects.equals(outWorkshopDate, that.outWorkshopDate) &&
Objects.equals(qualityPeopleName, that.qualityPeopleName) &&
Objects.equals(qualityTestDate, that.qualityTestDate) &&
Objects.equals(exceptionInformation, that.exceptionInformation) &&
Objects.equals(outStorageDate, that.outStorageDate) &&
Objects.equals(inStorageDate, that.inStorageDate) &&
Objects.equals(groupNo, that.groupNo) &&
Objects.equals(validCount, that.validCount) &&
Objects.equals(invalidCount, that.invalidCount) &&
Objects.equals(groupCount, that.groupCount) &&
Objects.equals(cityName, that.cityName) &&
printerId == that.printerId &&
taskStateId == that.taskStateId &&
Objects.equals(isException, that.isException);
}
@Override
public int hashCode() {
return Objects.hash(taskId, cardType, oldCardType, citycode, submitDate, issuedDate, printState, downloadDate, printOutDate, positionDate, outWorkshopDate, qualityPeopleName, qualityTestDate, exceptionInformation,outStorageDate,inStorageDate,printerId,taskStateId,isException,cityName,invalidCount,validCount,groupNo,groupCount);
}
}
package com.yxproject.start.entity;
import javax.persistence.*;
import java.util.List;
import java.util.Objects;
/**
* Created by Administrator on 2018/12/19.
*/
@Entity
@Table(name = "RECEIPT_LIST", schema = "DAHAI")
public class ReceiptListEntity {
private String countyName;
private long boxCount;
private long xiaoJi;
private String PTZ;
private String KZ;
private String YDKSY;
private String YDKSP;
private String YDY;
private String YDP;
private String JRZ;
private String KSY;
private String KSP;
private String YJZ;
@Id
@Column(name = "countyName", nullable = false, length = 20)
public String getCountyName() {
return countyName;
}
public void setCountyName(String countyName) {
this.countyName = countyName;
}
@Basic
@Column(name = "boxCount", nullable = true, precision = 0)
public long getBoxCount() {
return boxCount;
}
public void setBoxCount(long boxCount) {
this.boxCount = boxCount;
}
@Basic
@Column(name = "xiaoJi", nullable = true, precision = 0)
public long getXiaoJi() {
return xiaoJi;
}
public void setXiaoJi(long xiaoJi) {
this.xiaoJi = xiaoJi;
}
@Basic
@Column(name = "PTZ", nullable = true, precision = 0)
public String getPTZ() {
return PTZ;
}
public void setPTZ(String PTZ) {
this.PTZ = PTZ;
}
@Basic
@Column(name = "KZ", nullable = true, precision = 0)
public String getKZ() {
return KZ;
}
public void setKZ(String KZ) {
this.KZ = KZ;
}
@Basic
@Column(name = "YDKSY", nullable = true, precision = 0)
public String getYDKSY() {
return YDKSY;
}
public void setYDKSY(String YDKSY) {
this.YDKSY = YDKSY;
}
@Basic
@Column(name = "YDKSP", nullable = true, precision = 0)
public String getYDKSP() {
return YDKSP;
}
public void setYDKSP(String YDKSP) {
this.YDKSP = YDKSP;
}
@Basic
@Column(name = "YDY", nullable = true, precision = 0)
public String getYDY() {
return YDY;
}
public void setYDY(String YDY) {
this.YDY = YDY;
}
@Basic
@Column(name = "YDP", nullable = true, precision = 0)
public String getYDP() {
return YDP;
}
public void setYDP(String YDP) {
this.YDP = YDP;
}
@Basic
@Column(name = "JRZ", nullable = true, precision = 0)
public String getJRZ() {
return JRZ;
}
public void setJRZ(String JRZ) {
this.JRZ = JRZ;
}
@Basic
@Column(name = "KSY", nullable = true, precision = 0)
public String getKSY() {
return KSY;
}
public void setKSY(String KSY) {
this.KSY = KSY;
}
@Basic
@Column(name = "KSP", nullable = true, precision = 0)
public String getKSP() {
return KSP;
}
public void setKSP(String KSP) {
this.KSP = KSP;
}
@Basic
@Column(name = "YJZ", nullable = true, precision = 0)
public String getYJZ() {
return YJZ;
}
public void setYJZ(String YJZ) {
this.YJZ = YJZ;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ReceiptListEntity that = (ReceiptListEntity) o;
return boxCount == that.boxCount &&
xiaoJi == that.xiaoJi &&
Objects.equals(countyName, that.countyName) &&
Objects.equals(PTZ, that.PTZ) &&
Objects.equals(KZ, that.KZ) &&
Objects.equals(YDKSY, that.YDKSY) &&
Objects.equals(YDKSP, that.YDKSP) &&
Objects.equals(YDY, that.YDY) &&
Objects.equals(YDP, that.YDP) &&
Objects.equals(JRZ, that.JRZ) &&
Objects.equals(KSY, that.KSY) &&
Objects.equals(KSP, that.KSP) &&
Objects.equals(YJZ, that.YJZ);
}
@Override
public int hashCode() {
return Objects.hash(boxCount, xiaoJi, countyName, PTZ, KZ, YDKSY, YDKSP, YDY, YDP, JRZ, KSY, KSP, YJZ);
}
}
......@@ -31,8 +31,6 @@ public class TaskEntity {
private long is_Exception;
private long printer_Id;
@Id
@Column(name = "TASK_ID", nullable = false, precision = 0)
public long getTask_Id() {
......
......@@ -2,6 +2,7 @@ package com.yxproject.start.mapper;
import com.yxproject.start.entity.CountyEntity;
import com.yxproject.start.entity.CountyListEntity;
import com.yxproject.start.entity.ReceiptListEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -17,7 +18,7 @@ import java.util.Map;
public interface CountyListMapper {
public List<CountyEntity> findCountyList(@Param("taskListId") String taskListId,@Param("taskStateId") String taskStateId,@Param("cardType") String cardType);
public int updateBoundCount(@Param("county_List_Id") String county_List_Id,@Param("out_Storage_Count") String out_Storage_Count,@Param("in_Storage_Count") String in_Storage_Count);
public List<CountyListEntity> getConnectList( @Param("startDate")String startDate , @Param("endDate") String endDate);
public List<ReceiptListEntity> getReceiptList( @Param("startDate")String startDate , @Param("endDate") String endDate);
public List<CountyListEntity> findStorageCountByTaskListId(String taskListId);
// public List<Map<String, Object>> PrintCountyListXML();
......
......@@ -21,8 +21,6 @@ public interface GroupNoMapper {
public List<Map<String,Object>> findSpecialCountyList(String task_Id);
public List<Map<String,Object>> findNormalCountyList(String task_Id);
public List<GroupListEntity> findGroupListByTaskListId( String taskListId);
public List<GroupListEntity> findGroupListByTaskStateId(String taskStateId);
public List<GroupListEntity> findGroupListByCardType( String cardType);
}
package com.yxproject.start.service;
import org.springframework.stereotype.Service;
import com.yxproject.start.entity.*;
import java.util.List;
import java.util.Map;
/**
* Created by Administrator on 2018/12/19.
*/
@Service
public interface CityListService {
public List <CityListEntity> findCityList( String taskStateId ,String cardType);
// public List <CityListEntity> findCityListByCardType(String cardType);
}
......@@ -8,7 +8,6 @@ import java.util.Map;
public interface CountyListService {
public List<CountyListEntity> getConnectList(String startDate,String endDate);
public List<CountyListEntity> findStorageCountByTaskListId(String taskListId);
public int reviseBoundCount(String county_List_Id, String out_Storage_Count, String in_Storage_Count);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.CountyEntity;
import java.util.List;
/**
* Created by Administrator on 2018/12/19.
*/
public interface CountyService {
public List<CountyEntity> findCountyList( String taskListId,String taskStateId,String cardType);
}
......@@ -10,6 +10,5 @@ import java.util.List;
public interface GroupListService {
public List<GroupListEntity> findGroupListByTaskListId( String taskListId);
public List<GroupListEntity> findGroupListByTaskStateId(String taskStateId);
public List<GroupListEntity> findGroupListByCardType(String cardType);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.ReceiptListEntity;
import java.util.List;
/**
* Created by Administrator on 2018/12/19.
*/
public interface ReceiptListService {
public List <ReceiptListEntity> getReceiptList( String startDate, String endDate);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.CityListEntity;
import com.yxproject.start.mapper.TaskMapper;
import com.yxproject.start.service.CityListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by Administrator on 2018/12/19.
*/
@Service
public class CityListServiceImpl implements CityListService {
@Autowired
public TaskMapper taskMapper;
@Override
public List <CityListEntity> findCityList( String taskStateId ,String cardType) {
List <CityListEntity> cityList =taskMapper.findCityList(taskStateId, cardType);
return cityList;
}
}
......@@ -35,10 +35,6 @@ public class CountyListServiceImpl implements CountyListService {
return i;
}
@Override
public List<CountyListEntity> getConnectList(String startDate,String endDate) {
return countyListMapper.getConnectList(startDate,endDate);
}
@Override
public List<CountyListEntity> findStorageCountByTaskListId(String taskListId){
return countyListMapper.findStorageCountByTaskListId(taskListId);
......
package com.yxproject.start.service.impl;
//import com.yxproject.start.entity.CountyEntity;
import com.yxproject.start.entity.CountyEntity;
import com.yxproject.start.mapper.CountyListMapper;
import com.yxproject.start.service.CountyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2018/12/19.
*/
@Service
public class CountyServiceImpl implements CountyService {
@Autowired
public CountyListMapper countyListMapper;
@Override
public List <CountyEntity> findCountyList( String taskListId, String taskStateId, String cardType ) {
List<CountyEntity> county = countyListMapper.findCountyList(taskListId,taskStateId,cardType);
return county;
}
}
\ No newline at end of file
......@@ -31,23 +31,4 @@ public class GroupListServiceImpl implements GroupListService {
return groupList;
}
@Override
public List <GroupListEntity> findGroupListByTaskStateId(String taskStateId) {
List<GroupListEntity> byTaskStateId = groupNoMapper.findGroupListByTaskStateId(taskStateId);
for ( GroupListEntity groupListEntity:byTaskStateId) {
List <SpecialCardEntity> specialCardEntities=specialCardMapper.findSpecialCardList(groupListEntity.getGroupNo()+"");
groupListEntity.setSpecialCardList(specialCardEntities);
}
return byTaskStateId;
}
@Override
public List <GroupListEntity> findGroupListByCardType( String cardType ) {
List<GroupListEntity> byCardType = groupNoMapper.findGroupListByCardType(cardType);
for ( GroupListEntity groupListEntity:byCardType) {
List <SpecialCardEntity> specialCardEntities=specialCardMapper.findSpecialCardList(groupListEntity.getGroupNo()+"");
groupListEntity.setSpecialCardList(specialCardEntities);
}
return byCardType;
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.ReceiptListEntity;
import com.yxproject.start.mapper.CountyListMapper;
import com.yxproject.start.service.ReceiptListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by Administrator on 2018/12/19.
*/
@Service
public class ReceiptListServiceImpl implements ReceiptListService {
@Autowired
public CountyListMapper countyListMapper;
@Override
public List <ReceiptListEntity> getReceiptList( String startDate, String endDate ) {
return countyListMapper.getReceiptList(startDate,endDate);
}
}
......@@ -18,35 +18,48 @@
SELECT COUNTY_LIST.COUNTY_CODE,FINISH_COUNT,IN_STORAGE_COUNT,OUT_STORAGE_COUNT,COUNTY_DIC.COUNTYNAME FROM COUNTY_LIST
LEFT JOIN TASK ON COUNTY_LIST.TASK_ID = TASK.TASK_ID
LEFT JOIN COUNTY_DIC ON COUNTY_LIST.COUNTY_CODE = COUNTY_DIC.COUNTY_CODE
where TASK.TASK_ID=#{taskListId} or TASK.CARD_TYPE=#{cardType} or TASK.TASK_STATE_ID=#{taskStateId}
WHERE TASK.TASK_ID=#{taskListId} AND TASK.CARD_TYPE=#{cardType} AND TASK.TASK_STATE_ID=#{taskStateId}
</select>
<!--<select id="findCountyListByTaskStateId" resultType="com.yxproject.start.entity.CountyEntity" parameterType="String">-->
<!--SELECT COUNTY_LIST.COUNTY_CODE,FINISH_COUNT,IN_STORAGE_COUNT,OUT_STORAGE_COUNT,COUNTYNAME FROM COUNTY_LIST-->
<!--LEFT JOIN TASK ON COUNTY_LIST.TASK_ID = TASK.TASK_ID-->
<!--LEFT JOIN COUNTY_DIC ON COUNTY_LIST.COUNTY_CODE = COUNTY_DIC.COUNTY_CODE-->
<!--where TASK.TASK_STATE_ID=#{task_State_Id}-->
<!--</select>-->
<!--<select id="findCountyListByCardType" resultType="com.yxproject.start.entity.CountyEntity" parameterType="String">-->
<!--SELECT COUNTY_LIST.COUNTY_CODE,FINISH_COUNT,IN_STORAGE_COUNT,OUT_STORAGE_COUNT,COUNTYNAME FROM COUNTY_LIST-->
<!--LEFT JOIN TASK ON COUNTY_LIST.TASK_ID = TASK.TASK_ID-->
<!--LEFT JOIN COUNTY_DIC ON COUNTY_LIST.COUNTY_CODE = COUNTY_DIC.COUNTY_CODE-->
<!--where TASK.CARD_TYPE=#{card_Type}-->
<!--</select>-->
<update id="updateBoundCount" parameterType="String" >
update COUNTY_LIST SET OUT_STORAGE_COUNT =#{out_Storage_Count},IN_STORAGE_COUNT =#{in_Storage_Count} where COUNTY_LIST_ID =#{county_List_Id}
</update>
<select id="getConnectList" resultType="java.util.HashMap" parameterType="String">
SELECT COUNTY_DIC.COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,SUM(COUNTY_LIST.OUT_STORAGE_COUNT),floor(SUM(COUNTY_LIST.OUT_STORAGE_COUNT)/250)+1 FROM COUNTY_LIST
LEFT JOIN (SELECT COUNTY_CODE,COUNTYNAME FROM COUNTY_DIC GROUP BY COUNTY_CODE,COUNTYNAME ) COUNTY_DIC ON COUNTY_LIST.COUNTY_CODE = COUNTY_DIC.COUNTY_CODE
LEFT JOIN (SELECT TASK_ID,CARD_TYPE FROM TASK GROUP BY TASK_ID,CARD_TYPE) TASK ON COUNTY_LIST.TASK_ID = TASK.TASK_ID
LEFT JOIN(SELECT CARD_TYPE_ID,CARD_TYPE FROM CARD_TYPE_DIC GROUP BY CARD_TYPE_ID,CARD_TYPE ) CARD_TYPE_DIC ON CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE
WHERE substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8) >= #{startDate}
AND #{endDate} >= substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8)
GROUP BY COUNTY_DIC.COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE
<select id="getReceiptList" resultType="com.yxproject.start.entity.ReceiptListEntity" parameterType="String">
WITH
t_county
AS(
SELECT COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,SUM(COUNTY_LIST.OUT_STORAGE_COUNT) AS TYPE_COUNT,floor(SUM(COUNTY_LIST.OUT_STORAGE_COUNT)/250)+1 AS BOX_COUNT,SAVE_DATE
FROM (SELECT CARD_TYPE_ID,CARD_TYPE FROM CARD_TYPE_DIC GROUP BY CARD_TYPE_ID,CARD_TYPE ) CARD_TYPE_DIC
LEFT JOIN (SELECT TASK_ID,CARD_TYPE FROM TASK GROUP BY TASK_ID,CARD_TYPE) TASK ON CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE
LEFT JOIN (SELECT COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE FROM COUNTY_LIST GROUP BY COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE) COUNTY_LIST ON COUNTY_LIST.TASK_ID = TASK.TASK_ID
LEFT JOIN (SELECT COUNTY_CODE,COUNTYNAME FROM COUNTY_DIC GROUP BY COUNTY_CODE,COUNTYNAME ) COUNTY_DIC ON COUNTY_LIST.COUNTY_CODE = COUNTY_DIC.COUNTY_CODE
GROUP BY COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,SAVE_DATE
),
t_total_count
AS(
SELECT * FROM (SELECT COUNTYNAME,CARD_TYPE,TYPE_COUNT,BOX_COUNT,SAVE_DATE FROM t_county) PIVOT(SUM(TYPE_COUNT) FOR CARD_TYPE IN ('普通证' AS PTZ,'快证' AS KZ,'省内异地快速通道邮' AS YDKSY,'省内异地快速通道
普' AS YDKSP,'省内异地邮' AS YDY,'省内异地普' AS YDP,'军人证' AS JRZ,'快速通道普' AS KSP,'快速通道邮' AS KSY,'邮寄证' AS YJZ))
),
county_xiaoji
AS(
SELECT COUNTYNAME,SUM(TYPE_COUNT) AS XIAOJI FROM t_county GROUP BY COUNTYNAME
)
SELECT DECODE(GROUPING(t_total_count.COUNTYNAME),1,'总计',t_total_count.COUNTYNAME)COUNTYNAME,
SUM(PTZ)PTZ,
SUM(KZ)KZ,
SUM(YDKSY)YDKSY,
SUM(YDKSP)YDKSP,
SUM(YDY)YDY,
SUM(YDP)YDP,
SUM(JRZ)JRZ,
SUM(KSP)KSP,
SUM(KSY)KSY,
SUM(YJZ)YJZ,
SUM(XIAOJI)XIAOJI,
SUM(BOX_COUNT)BOX_COUNT
FROM t_total_count,county_xiaoji WHERE t_total_count.COUNTYNAME=county_xiaoji.COUNTYNAME AND substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8) >= #{startDate} AND #{endDate} >= substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8)
GROUP BY ROLLUP(t_total_count.COUNTYNAME)
</select>
<select id="findStorageCountByTaskListId" resultType="java.util.HashMap" parameterType="String">
......
......@@ -44,25 +44,12 @@
</select>
<select id="findGroupListByTaskListId" resultType="com.yxproject.start.entity.GroupListEntity" parameterType="String">
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount from TASK
left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount from (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO
left join TASK on GROUP_NO.TASK_ID = TASK.TASK_ID
where TASK.TASK_ID=#{task_Id}
group by GROUP_NO
</select>
<select id="findGroupListByTaskStateId" resultType="com.yxproject.start.entity.GroupListEntity" parameterType="String">
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount from TASK
left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
where TASK.TASK_STATE_ID=#{task_State_Id}
group by GROUP_NO
</select>
<select id="findGroupListByCardType" resultType="com.yxproject.start.entity.GroupListEntity" parameterType="String">
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount from TASK
left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
where TASK.CARD_TYPE=#{card_type}
group by GROUP_NO
</select>
......
......@@ -95,7 +95,7 @@
SELECT CARD_TYPE,TASK.CITYCODE,CITYNAME AS cityName,sum(VALID_COUNT) AS validCount,sum(INVALID_COUNT) AS invalidCount,COUNT(GROUP_NO) AS groupCount,GROUP_NO AS groupNo,TASK.TASK_ID,OLD_CARD_TYPE,SUBMIT_DATE,ISSUED_DATE,PRINT_STATE,DOWNLOAD_DATE,PRINT_OUT_DATE,POSITION_DATE,OUT_WORKSHOP_DATE,QUALITY_PEOPLE_NAME,QUALITY_TEST_DATE,EXCEPTION_INFORMATION,OUT_STORAGE_DATE,IN_STORAGE_DATE,TASK_STATE_ID,IS_EXCEPTION,PRINTER_ID from (select sum(VALID_COUNT),sum(INVALID_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO
left join TASK on GROUP_NO.TASK_ID = TASK.TASK_ID
left join (SELECT CITYCODE,CITYNAME FROM CITY_DIC) CITY_DIC on CITY_DIC.CITYCODE = TASK.CITYCODE
where CARD_TYPE=#{cardType} or TASK_STATE_ID = #{taskStateId}
where CARD_TYPE=#{cardType} and TASK_STATE_ID = #{taskStateId}
GROUP BY CARD_TYPE,TASK.CITYCODE,CITYNAME,GROUP_NO,TASK.TASK_ID,OLD_CARD_TYPE,SUBMIT_DATE,ISSUED_DATE,PRINT_STATE,DOWNLOAD_DATE,PRINT_OUT_DATE,POSITION_DATE,OUT_WORKSHOP_DATE,QUALITY_PEOPLE_NAME,QUALITY_TEST_DATE,EXCEPTION_INFORMATION,OUT_STORAGE_DATE,IN_STORAGE_DATE,TASK_STATE_ID,IS_EXCEPTION,PRINTER_ID
</select>
......
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