Commit fd92d9d4 authored by Administrator's avatar Administrator

修改了groupList,conutyList,typeList,派出所申领表,交接单,

parent 3d495c0e
...@@ -88,6 +88,10 @@ ...@@ -88,6 +88,10 @@
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
<version>3.13</version> <version>3.13</version>
</dependency> </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<!-- MyBatis分页插件 --> <!-- MyBatis分页插件 -->
<!--<dependency>--> <!--<dependency>-->
......
<?xml version="1.0" encoding="UTF-8"?>
<countyLists>
<countyList county_List_Id="imooc-001" task_Id="20181204">
<saveDate>2018-12-04</saveDate>
<countyCode>413200</countyCode>
<finishCount>1030</finishCount>
<inStorageCount>1030</inStorageCount>
<outStorageCount>1030</outStorageCount>
</countyList>
<countyList county_List_Id="imooc-002" task_Id="20181205">
<saveDate>2018-12-05</saveDate>
<countyCode>413200</countyCode>
<finishCount>1030</finishCount>
<inStorageCount>1030</inStorageCount>
<outStorageCount>1030</outStorageCount>
</countyList>
</countyLists>
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
version="2.0">
<entity class="com.yxproject.start.entity.AccGroupRelationTEntity">
<table name="ACC_GROUP_RELATION_T" schema="ACC_DBA" catalog=""/>
<attributes>
<id name="groupNo">
<column name="GROUP_NO" length="10"/>
</id>
<basic name="originalNo">
<column name="ORIGINAL_NO" length="25"/>
</basic>
<basic name="dealStatus">
<column name="DEAL_STATUS" nullable="false" length="1"/>
</basic>
<basic name="dealDate">
<column name="DEAL_DATE" length="8"/>
</basic>
<basic name="uploadUnitNo">
<column name="UPLOAD_UNIT_NO" length="12"/>
</basic>
</attributes>
</entity>
</entity-mappings>
...@@ -48,6 +48,7 @@ public class CountyListEntity { ...@@ -48,6 +48,7 @@ public class CountyListEntity {
public void setSave_Date(Date save_Date) { public void setSave_Date(Date save_Date) {
this.save_Date = save_Date; this.save_Date = save_Date;
} }
@Basic @Basic
@Column(name = "COUNTY_CODE", nullable = true, length = 20) @Column(name = "COUNTY_CODE", nullable = true, length = 20)
public String getCounty_Code() { public String getCounty_Code() {
...@@ -57,6 +58,7 @@ public class CountyListEntity { ...@@ -57,6 +58,7 @@ public class CountyListEntity {
public void setCounty_Code(String county_Code) { public void setCounty_Code(String county_Code) {
this.county_Code = county_Code; this.county_Code = county_Code;
} }
@Basic @Basic
@Column(name = "FINISH_COUNT", nullable = true, precision = 0) @Column(name = "FINISH_COUNT", nullable = true, precision = 0)
public long getFinish_Count() { public long getFinish_Count() {
...@@ -66,6 +68,7 @@ public class CountyListEntity { ...@@ -66,6 +68,7 @@ public class CountyListEntity {
public void setFinish_Count(long finish_Count) { public void setFinish_Count(long finish_Count) {
this.finish_Count = finish_Count; this.finish_Count = finish_Count;
} }
@Basic @Basic
@Column(name = "IN_STORAGE_COUNT", nullable = true, precision = 0) @Column(name = "IN_STORAGE_COUNT", nullable = true, precision = 0)
public long getIn_Storage_Count() { public long getIn_Storage_Count() {
...@@ -75,6 +78,7 @@ public class CountyListEntity { ...@@ -75,6 +78,7 @@ public class CountyListEntity {
public void setIn_Storage_Count(long in_Storage_Count) { public void setIn_Storage_Count(long in_Storage_Count) {
this.in_Storage_Count = in_Storage_Count; this.in_Storage_Count = in_Storage_Count;
} }
@Basic @Basic
@Column(name = "OUT_STORAGE_COUNT", nullable = true, precision = 0) @Column(name = "OUT_STORAGE_COUNT", nullable = true, precision = 0)
public long getOut_Storage_Count() { public long getOut_Storage_Count() {
...@@ -103,4 +107,9 @@ public class CountyListEntity { ...@@ -103,4 +107,9 @@ public class CountyListEntity {
public int hashCode() { public int hashCode() {
return Objects.hash(county_List_Id, task_Id, finish_Count, in_Storage_Count, out_Storage_Count,save_Date,county_Code); return Objects.hash(county_List_Id, task_Id, finish_Count, in_Storage_Count, out_Storage_Count,save_Date,county_Code);
} }
@Override
public String toString() {
return "COUNTY_LIST [county_List_Id=" + county_List_Id + ", task_Id=" + task_Id + ", finish_Count=" + finish_Count + ", in_Storage_Count=" + in_Storage_Count + ", out_Storage_Count=" + out_Storage_Count + ",save_Date=" + save_Date + "county_Code=" + county_Code +" ]";
}
} }
...@@ -18,6 +18,7 @@ public interface CountyListMapper { ...@@ -18,6 +18,7 @@ public interface CountyListMapper {
public List<CountyListEntity> findCountyListByTaskStateId(String taskStateId); public List<CountyListEntity> findCountyListByTaskStateId(String taskStateId);
public List<CountyListEntity> findCountyListByCardType(String cardType); public List<CountyListEntity> findCountyListByCardType(String cardType);
public int updateBoundCount(CountyListEntity countyListEntity); public int updateBoundCount(CountyListEntity countyListEntity);
public List<Map<String,Object>> getConnectList(String save_Date); public List<CountyListEntity> getConnectList(String save_Date);
// public List<Map<String, Object>> PrintCountyListXML();
} }
...@@ -15,7 +15,7 @@ public interface PoliceStationApplyReasonMapper { ...@@ -15,7 +15,7 @@ public interface PoliceStationApplyReasonMapper {
public int updatePoliceStationApplyReasonEntity(PoliceStationApplyReasonEntity policeStationApplyReasonEntity); public int updatePoliceStationApplyReasonEntity(PoliceStationApplyReasonEntity policeStationApplyReasonEntity);
public List<Map<String,Object>> findNormalApplyReasonByCyclesheetID(String cyclesheetid); public List<Map<String,Object>> findNormalApplyReasonByCyclesheetID(String cyclesheetid);
public List<Map<String,Object>> findSpecialApplyReasonByCyclesheetID(String cyclesheetid); public List<Map<String,Object>> findSpecialApplyReasonByCyclesheetID(String cyclesheetid);
public List<Map<String,Object>> findPoliceStationApplyReasonBySaveDate(String saveDate); public List<Map<String,Object>> findPoliceStationApplyReasonBySaveDate(String save_Date);
public List<Map<String,Object>> findPoliceStationApplyReasonByCardType(String cardType); public List<Map<String,Object>> findPoliceStationApplyReasonByCardType(String cardType);
public List<Map<String,Object>> findPoliceStationApplyReasonByCity(String city); public List<Map<String,Object>> findPoliceStationApplyReasonByCity(String city);
public List<Map<String,Object>> findPoliceStationApplyReasonByCounty(String county); public List<Map<String,Object>> findPoliceStationApplyReasonByCounty(String county);
......
...@@ -4,7 +4,6 @@ import com.yxproject.start.entity.CountyListEntity; ...@@ -4,7 +4,6 @@ import com.yxproject.start.entity.CountyListEntity;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
public interface CountyListService { public interface CountyListService {
...@@ -12,6 +11,6 @@ public interface CountyListService { ...@@ -12,6 +11,6 @@ public interface CountyListService {
public List<CountyListEntity> findCountyListByTaskStateId(String taskStateId); public List<CountyListEntity> findCountyListByTaskStateId(String taskStateId);
public int reviseOutBoundCount(CountyListEntity countyListEntity); public int reviseOutBoundCount(CountyListEntity countyListEntity);
public int reviseInBoundCount(CountyListEntity countyListEntity); public int reviseInBoundCount(CountyListEntity countyListEntity);
public List<Map<String, Object>> getConnectList(String save_Date); public List<CountyListEntity> getConnectList(String save_Date);
public List<CountyListEntity> findCountyListByCardType(String cardType); public List<CountyListEntity> findCountyListByCardType(String cardType);
} }
...@@ -8,7 +8,7 @@ import java.util.Map; ...@@ -8,7 +8,7 @@ import java.util.Map;
*/ */
public interface PoliceStationApplyReasonService { public interface PoliceStationApplyReasonService {
public int savePoliceStationApplyReasonEntity(String cyclesheetID); public int savePoliceStationApplyReasonEntity(String cyclesheetID);
public List<Map<String,Object>> findPoliceStationApplyReasonBySaveDate(String saveDate); public List<Map<String,Object>> findPoliceStationApplyReasonBySaveDate(String save_Date);
public List<Map<String,Object>> findPoliceStationApplyReasonByCardType(String cardType); public List<Map<String,Object>> findPoliceStationApplyReasonByCardType(String cardType);
public List<Map<String,Object>> findPoliceStationApplyReasonByCity(String cityCode); public List<Map<String,Object>> findPoliceStationApplyReasonByCity(String cityCode);
} }
...@@ -10,7 +10,7 @@ public interface TaskService { ...@@ -10,7 +10,7 @@ public interface TaskService {
public List<TaskEntity> findProductionTaskListEntityByID(long id); public List<TaskEntity> findProductionTaskListEntityByID(long id);
public int updateProductionTask(TaskEntity map); public int updateProductionTask(TaskEntity taskId);
public int addProductionTaskListEntity(TaskEntity taskEntity, List<GroupNoEntity> groupNoEntities); public int addProductionTaskListEntity(TaskEntity taskEntity, List<GroupNoEntity> groupNoEntities);
......
...@@ -6,10 +6,8 @@ import com.yxproject.start.service.CountyListService; ...@@ -6,10 +6,8 @@ import com.yxproject.start.service.CountyListService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Created by liuxinben on 2018/11/6.13:42 * Created by liuxinben on 2018/11/6.13:42
...@@ -51,7 +49,7 @@ public class CountyListServiceImpl implements CountyListService { ...@@ -51,7 +49,7 @@ public class CountyListServiceImpl implements CountyListService {
} }
@Override @Override
public List<Map<String, Object>> getConnectList(String save_Date) { public List<CountyListEntity> getConnectList(String save_Date) {
return countyListMapper.getConnectList(save_Date); return countyListMapper.getConnectList(save_Date);
} }
......
...@@ -54,8 +54,8 @@ public class PoliceStationApplyReasonServiceImpl implements PoliceStationApplyRe ...@@ -54,8 +54,8 @@ public class PoliceStationApplyReasonServiceImpl implements PoliceStationApplyRe
* @return * @return
*/ */
@Override @Override
public List <Map <String, Object>> findPoliceStationApplyReasonBySaveDate( String saveDate ) { public List <Map <String, Object>> findPoliceStationApplyReasonBySaveDate( String save_Date ) {
List <Map <String, Object>> SaveData =policeStationApplyReasonMapper.findPoliceStationApplyReasonBySaveDate(saveDate); List <Map <String, Object>> SaveData =policeStationApplyReasonMapper.findPoliceStationApplyReasonBySaveDate(save_Date);
return SaveData; return SaveData;
} }
......
...@@ -62,7 +62,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -62,7 +62,7 @@ public class TaskServiceImpl implements TaskService {
* @return * @return
*/ */
@Override @Override
public int updateProductionTask(TaskEntity taskEntity) { public int updateProductionTask( TaskEntity taskEntity ) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
//todo 状态更新时间 //todo 状态更新时间
Long state = taskEntity.getTask_State_Id(); Long state = taskEntity.getTask_State_Id();
......
...@@ -30,8 +30,12 @@ ...@@ -30,8 +30,12 @@
update COUNTY_LIST SET OUT_STORAGE_COUNT =#{out_Storage_Count},IN_STORAGE_COUNT =#{in_Storage_Count} where COUNTY_LIST_ID =#{county_List_Id} update COUNTY_LIST SET OUT_STORAGE_COUNT =#{out_Storage_Count},IN_STORAGE_COUNT =#{in_Storage_Count} where COUNTY_LIST_ID =#{county_List_Id}
</update> </update>
<select id="getConnectList" resultType="com.yxproject.start.entity.CountyListEntity" parameterType="String"> <select id="getConnectList" resultType="Map" parameterType="String">
SELECT OUT_STORAGE_COUNT FROM COUNTY_LIST 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 TO_CHAR(SAVE_DATE,'yyyyMMdd') = #{save_Date} GROUP BY COUNTY_DIC.COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE
</select> </select>
<!--<select id="PrintCountyListXML" resultType="com.yxproject.start.entity.CountyListEntity" parameterType="String">-->
<!--SELECT * FROM COUNTY_LIST-->
<!--</select>-->
</mapper> </mapper>
...@@ -44,15 +44,15 @@ ...@@ -44,15 +44,15 @@
</select> </select>
<select id="findGroupNoByTaskListID" resultType="com.yxproject.start.entity.GroupNoEntity" parameterType="String"> <select id="findGroupNoByTaskListID" resultType="com.yxproject.start.entity.GroupNoEntity" parameterType="String">
SELECT * FROM GROUP_NO left join TASK on GROUP_NO.TASK_ID = TASK.TASK_ID where TASK_ID=#{task_Id} select GROUP_NO,sum(VAILD_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO) from TASK left join (select sum(VAILD_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID where TASK.TASK_ID=#{task_Id} GROUP BY GROUP_NO
</select> </select>
<select id="findGroupNoByTaskStateId" resultType="com.yxproject.start.entity.GroupNoEntity" parameterType="String"> <select id="findGroupNoByTaskStateId" resultType="com.yxproject.start.entity.GroupNoEntity" parameterType="String">
SELECT * FROM GROUP_NO left join TASK on GROUP_NO.TASK_ID = TASK.TASK_ID where TASK_STATE_ID=#{task_State_Id} select GROUP_NO,sum(VAILD_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO) from TASK left join (select sum(VAILD_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_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>
<select id="findGroupNoByCardType" resultType="com.yxproject.start.entity.GroupNoEntity" parameterType="String"> <select id="findGroupNoByCardType" resultType="com.yxproject.start.entity.GroupNoEntity" parameterType="String">
SELECT * FROM GROUP_NO left join TASK on GROUP_NO.TASK_ID = TASK.TASK_ID where CARD_TYPE=#{card_type} select GROUP_NO,sum(VAILD_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO) from TASK left join (select sum(VAILD_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID where TASK.CARD_TYPE=#{card_type} GROUP BY GROUP_NO
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
SELECT * FROM TABLE(find_special_apply_reason_list.get_apply_reason_list(#{cyclesheetid})) SELECT * FROM TABLE(find_special_apply_reason_list.get_apply_reason_list(#{cyclesheetid}))
</select> </select>
<select id="findPoliceStationApplyReasonBySaveDate" resultType="java.util.HashMap" parameterType="com.yxproject.start.entity.PoliceStationApplyReasonEntity"> <select id="findPoliceStationApplyReasonBySaveDate" resultType="Map" parameterType="String">
SELECT * FROM POLICE_STATION_APPLY_REASON where SAVE_DATE=#{save_Data} SELECT * FROM POLICE_STATION_APPLY_REASON where TO_CHAR(SAVE_DATE,'yyyyMMdd') = #{save_Date}
</select> </select>
<select id="findPoliceStationApplyReasonByCardType" resultType="java.util.HashMap" parameterType="com.yxproject.start.entity.PoliceStationApplyReasonEntity"> <select id="findPoliceStationApplyReasonByCardType" resultType="java.util.HashMap" parameterType="com.yxproject.start.entity.PoliceStationApplyReasonEntity">
......
...@@ -77,59 +77,15 @@ ...@@ -77,59 +77,15 @@
</select> </select>
<select id="findTypeListByTaskStateId" resultType="java.util.HashMap"> <select id="findTypeListByTaskStateId" resultType="java.util.HashMap">
WITH SELECT TASK.CARD_TYPE,count(CARD_TYPE_ID),CARD_TYPE_DIC.CARD_TYPE FROM TASK left join (SELECT CARD_TYPE,count(CARD_TYPE_ID),CARD_TYPE_ID FROM CARD_TYPE_DIC GROUP BY CARD_TYPE,CARD_TYPE_ID) CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE where TASK_STATE_ID=#{task_State_Id} GROUP BY CARD_TYPE_DIC.CARD_TYPE,TASK.CARD_TYPE
t_Type_List
AS(
select CARD_TYPE_ID,CARD_TYPE_DIC.CARD_TYPE from TASK left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE where TASK_STATE_ID=#{task_State_Id}
),
t_Count_Card_Type
AS(
select CARD_TYPE_ID, count(CARD_TYPE_ID) qty from t_Type_List group by CARD_TYPE_ID
)
SELECT t1.CARD_TYPE_ID,t1.CARD_TYPE ,nvl(t2.qty,0) FROM t_Type_List t1 left join t_Count_Card_Type t2 on t1.CARD_TYPE_ID = t2.CARD_TYPE_ID
</select> </select>
<select id="findCityListByCardType" resultType="java.util.HashMap"> <select id="findCityListByCardType" resultType="java.util.HashMap">
WITH select CARD_TYPE,TASK.CITYCODE,CITYNAME,sum(VAILD_COUNT),sum(INVALID_COUNT),COUNT(GROUP_NO),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 from TASK left join (select sum(VAILD_COUNT),sum(INVALID_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_COUNT,INVALID_COUNT ) GROUP_NO 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=#{card_Type} 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
t_City_List
AS(
select GROUP_NO.GROUP_NO,CITY_DIC.CITYNAME,GROUP_NO.VAILD_COUNT,GROUP_NO.INVALID_COUNT,TASK.CITYCODE from TASK left join GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID left join CITY_DIC on TASK.CITYCODE=CITY_DIC.CITYCODE where CARD_TYPE=#{card_Type}
),
t_Count_VAILD_COUNT
AS(
select VAILD_COUNT, count(VAILD_COUNT) qty1 from t_City_List group by VAILD_COUNT
),
t_Count_INVALID_COUNT
AS(
select INVALID_COUNT, count(INVALID_COUNT) qty2 from t_City_List group by INVALID_COUNT
),
t_Sum_VAILD_COUNT
AS(
select VAILD_COUNT, SUM(VAILD_COUNT) qty3 from t_City_List group by VAILD_COUNT
)
SELECT t1.GROUP_NO,t1.CITYNAME,t1.CITYCODE,t1.VAILD_COUNT,t1.INVALID_COUNT,nvl(t2.qty1,0),nvl(t3.qty2,0),nvl(t4.qty3,0) FROM t_City_List t1 left join t_Count_VAILD_COUNT t2 on t1.VAILD_COUNT = t2.VAILD_COUNT left join t_Count_INVALID_COUNT t3 on t1.INVALID_COUNT=t3.INVALID_COUNT left join t_Sum_VAILD_COUNT t4 on t1.VAILD_COUNT=t4.VAILD_COUNT
</select> </select>
<select id="findCityListByTaskStateId" resultType="java.util.HashMap"> <select id="findCityListByTaskStateId" resultType="java.util.HashMap">
WITH select CARD_TYPE,TASK.CITYCODE,CITYNAME,sum(VAILD_COUNT),sum(INVALID_COUNT),COUNT(GROUP_NO),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 from TASK left join (select sum(VAILD_COUNT),sum(INVALID_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VAILD_COUNT,INVALID_COUNT ) GROUP_NO 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 TASK_STATE_ID=#{task_State_Id} 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
t_City_List
AS(
select GROUP_NO.GROUP_NO,CITY_DIC.CITYNAME,GROUP_NO.VAILD_COUNT,GROUP_NO.INVALID_COUNT,TASK.CITYCODE from TASK left join GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID left join CITY_DIC on TASK.CITYCODE=CITY_DIC.CITYCODE where TASK_STATE_ID=#{task_State_Id}
),
t_Count_VAILD_COUNT
AS(
select VAILD_COUNT, count(VAILD_COUNT) qty1 from t_City_List group by VAILD_COUNT
),
t_Count_INVALID_COUNT
AS(
select INVALID_COUNT, count(INVALID_COUNT) qty2 from t_City_List group by INVALID_COUNT
),
t_Sum_VAILD_COUNT
AS(
select VAILD_COUNT, SUM(VAILD_COUNT) qty3 from t_City_List group by VAILD_COUNT
)
SELECT t1.GROUP_NO,t1.CITYNAME,t1.CITYCODE,t1.VAILD_COUNT,t1.INVALID_COUNT,nvl(t2.qty1,0),nvl(t3.qty2,0),nvl(t4.qty3,0) FROM t_City_List t1 left join t_Count_VAILD_COUNT t2 on t1.VAILD_COUNT = t2.VAILD_COUNT left join t_Count_INVALID_COUNT t3 on t1.INVALID_COUNT=t3.INVALID_COUNT left join t_Sum_VAILD_COUNT t4 on t1.VAILD_COUNT=t4.VAILD_COUNT
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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