SELECT * FROM COUNTY_LIST left join TASK on COUNTY_LIST.TASK_ID = TASK.TASK_ID left join CARD_TYPE_DIC on TASK.CARD_TYPE = CARD_TYPE_DIC.CARD_TYPE_ID where CARD_TYPE_DIC.CARD_TYPE=#{card_Type}
SELECT * FROM POLICE_STATION_APPLY_REASON left join TASK on POLICE_STATION_APPLY_REASON.TASK_ID = TASK.TASK_ID left join CITY_DIC on TASK.CITYCODE = CITY_DIC.CITYCODE where CITYNAME=#{cityname}
SELECT * FROM POLICE_STATION_APPLY_REASON left join COUNTY_LIST on POLICE_STATION_APPLY_REASON.TASK_ID=COUNTY_LIST.TASK_ID left join COUNTY_DIC on COUNTY_LIST.COUNTY_CODE = COUNTY_DIC.COUNTY_CODE where COUNTYNAME=#{countyname}
SELECT * FROM POLICE_STATION_APPLY_REASON left join GAJG_DM on POLICE_STATION_APPLY_REASON.POLICE_STATION_CODE = GAJG_DM.GAJG_DM where GAJG_MC=#{gajg_MC}
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 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 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