Date DateStart = new SimpleDateFormat ("Yyyy-mm-dd"). Parse (starttime);
Date dateend = new SimpleDateFormat ("Yyyy-mm-dd"). Parse (Endtime);
Number of days apart/(24*60*60*1000)
Long day= (Dateend.gettime ()-datestart.gettime ());
The start time of pushing forward
String earlystartdate = new SimpleDateFormat ("Yyyy-mm-dd"). Format (Datestart.gettime ()-day);
String sql = null;
if ("All". Equals (Orgtwo)) {
sql = "Select DISTINCT tt.jc,count (1)"
+ "from T_xxbb t,t_bd_dw tt, T_dictionary TTT"
+ "where ttt.ref_typeid=301 and T.xxbb_type=0 and T.info_type=ttt.dicvalue and Ttt.dicvalue<>2"
+ "and tt.sjdw=4"
+ "and T.SBSJ BETWEEN to_date (' +earlystartdate+" ', ' Yyyy-mm-dd ') and to_date (' +starttime+ ', ' yyyy-mm-dd ') "
+ "GROUP by TT.JC";
sql = "Select Temp.jc,sum (TEMP.BH)"
+ "from" (select DISTINCT t.sbsj,tt.bh,tt. Sjdw,tt.jc,count (1) "
+ "from T_xxbb t,t_bd_dw tt, T_dictionary TTT"
+ "where TT.BH=T.SBDWBH (+) and ttt.ref_typeid=301 and T.info_type=ttt.dicvalue and Ttt.dicvalue<>2 and t.xxbb_t Ype=0 and TT. Sjdw=4 "
+ "and T.SBSJ BETWEEN to_date (' +earlystartdate+" ', ' Yyyy-mm-dd ') and to_date (' +starttime+ ', ' yyyy-mm-dd ') "
+ ' GROUP by T.SBSJ,TT.BH,TT.SJDW,TT.DM,TT.JC ' temp GROUP by TEMP.JC;
sql = "Select DISTINCT tt.jc,sum (TT.BH)"
+ "from T_xxbb t,t_bd_dw tt, T_dictionary TTT"
+ "where ttt.ref_typeid=301 and T.xxbb_type=0 and T.info_type=ttt.dicvalue"
+ "and tt.sjdw=4"
+ "and T.SBSJ BETWEEN to_date (' +earlystartdate+" ', ' Yyyy-mm-dd ') and to_date (' +starttime+ ', ' yyyy-mm-dd ') "
+ "GROUP by TT.JC";
}else {
sql = "Select DISTINCT tt.jc,count (1)"
+ "from T_xxbb t,t_bd_dw tt, T_dictionary TTT"
+ "where ttt.ref_typeid=301 and T.xxbb_type=0 and T.info_type=ttt.dicvalue and Ttt.dicvalue<>2"
+ "and tt.sjdw=4"
+ "and tt.jc= '" +orgtwo+ ""
+ "and T.SBSJ BETWEEN to_date (' +starttime+" ', ' Yyyy-mm-dd ') and to_date (' +endtime+ ', ' yyyy-mm-dd ') "
+ "GROUP by TT.JC";
sql = "Select Temp.jc,sum (TEMP.BH)"
+ "from" (select DISTINCT t.sbsj,tt.bh,tt. Sjdw,tt.jc,count (1) "
+ "from T_xxbb t,t_bd_dw tt, T_dictionary TTT"
+ "where TT.BH=T.SBDWBH (+) and ttt.ref_typeid=301 and T.info_type=ttt.dicvalue and Ttt.dicvalue<>2 and t.xxbb_t Ype=0 and TT. Sjdw=4 "
+ "and tt.jc= '" +orgtwo+ ""
+ "and T.SBSJ BETWEEN to_date (' +earlystartdate+" ', ' Yyyy-mm-dd ') and to_date (' +starttime+ ', ' yyyy-mm-dd ') "
+ ' GROUP by T.SBSJ,TT.BH,TT.SJDW,TT.DM,TT.JC ' temp GROUP by TEMP.JC;
Date DateStart = new SimpleDateFormat ("Yyyy-mm-dd"). Parse (starttime);
Date dateend = new SimpleDateFormat ("Yyyy-mm-dd"). Parse (Endtime);
Number of days apart/(24*60*60*1000)
Long day= (Dateend.gettime ()-datestart.gettime ());
The start time of pushing forward
String earlystartdate = new SimpleDateFormat ("Yyyy-mm-dd"). Format (Datestart.gettime ()-day);
String sql = null;
if ("Per day Analysis". Equals (Statisticsway)) {
if ("All". Equals (Orgtwo)) {
sql = "Select Temp.sbsj,sum (TEMP.BH)"
+ "from"
+ "(select To_char (T.SBSJ, ' yyyy-mm-dd ') sbsj,tt.bh,tt. Sjdw,tt.jc,count (1) "
+ "from T_xxbb t,t_bd_dw tt, T_dictionary TTT"
+ "where TT.BH=T.SBDWBH (+) and ttt.ref_typeid=301 and T.info_type=ttt.dicvalue and Ttt.dicvalue<>2 and T.xxbb_type =0 and Tt.sjdw=4 and "
+ "T.SBSJ BETWEEN to_date (' +earlystartdate+" ', ' Yyyy-mm-dd ') and to_date (' +starttime+ ', ' yyyy-mm-dd ') "
+ "GROUP by T.SBSJ,TT.BH,TT.SJDW,TT.DM,TT.JC Order by T.SBSJ ASC", temp Group by TEMP.SBSJ;
}else {
sql = "Select Temp.sbsj,sum (TEMP.BH)"
+ "from"
+ "(select To_char (T.SBSJ, ' yyyy-mm-dd ') sbsj,tt.bh,tt. Sjdw,tt.jc,count (1) "
+ "from T_xxbb t,t_bd_dw tt, T_dictionary TTT"
+ "where TT.BH=T.SBDWBH (+) and ttt.ref_typeid=301 and T.info_type=ttt.dicvalue and Ttt.dicvalue<>2 and T.xxbb_type =0 and Tt.sjdw=4 and "
+ "tt.jc= '" "+orgtwo+" "
+ "and T.SBSJ BETWEEN to_date (' +earlystartdate+" ', ' Yyyy-mm-dd ') and to_date (' +starttime+ ', ' yyyy-mm-dd ') "
+ "GROUP by T.SBSJ,TT.BH,TT.SJDW,TT.DM,TT.JC Order by T.SBSJ ASC", temp Group by TEMP.SBSJ;
}
} else {
Analysis by month
if ("All". Equals (Orgtwo)) {
sql = "Select Temp.sbsj,sum (TEMP.BH)"
+ "from"
+ "(select To_char (T.SBSJ, ' yyyy-mm ') sbsj,tt.bh,tt. Sjdw,tt.jc,count (1) "
+ "from T_xxbb t,t_bd_dw tt, T_dictionary TTT"
+ "where TT.BH=T.SBDWBH (+) and ttt.ref_typeid=301 and T.info_type=ttt.dicvalue and Ttt.dicvalue<>2 and T.xxbb_type =0 and Tt.sjdw=4 and "
+ "T.SBSJ BETWEEN to_date (' +earlystartdate+" ', ' Yyyy-mm-dd ') and to_date (' +starttime+ ', ' yyyy-mm-dd ') "
+ "GROUP by T.SBSJ,TT.BH,TT.SJDW,TT.DM,TT.JC Order by T.SBSJ ASC", temp Group by TEMP.SBSJ;
}else {
sql = "Select Temp.sbsj,sum (TEMP.BH)"
+ "from"
+ "(select To_char (T.SBSJ, ' yyyy-mm ') sbsj,tt.bh,tt. Sjdw,tt.jc,count (1) "
+ "from T_xxbb t,t_bd_dw tt, T_dictionary TTT"
+ "where TT.BH=T.SBD
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.