sql20171215sql

来源:互联网 发布:mysql delete 速度慢 编辑:程序博客网 时间:2024/05/19 17:57
public static JSONObject getJingDuNewAction1(JSONObject params,ActionContext context) throws SQLException, NamingException,java.sql.SQLException {
// 查询对应班组的工序
Connection conn = context.getConnection("jeecg");
//
JSONObject return1 =  new JSONObject();
//MainID
String id = params.getString("id");// 获取人员ID
String MainID = params.getString("MainID");// 获取人员ID
String personName = params.getString("personName");// 人员名称
String Time = params.getString("time");// 获取当前时间
String projectID = params.getString("projectID");// 获取项目名称
String fNo = "进度";
String st = "未完成";
//
java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());//获取sql java呼唤时间
System.out.println("获取到项目ID:" + projectID);
System.out.println("输出的" + Time);
//
//SQL批量执行
java.sql.Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
//查询排班中的所属桩号
String sql = "select  DISTINCT  y.fBasicsSubPlanSum,y.fTowerSubPlanSum,y.fStringingSubPlanSum,y.fID,y.fMasterID,y.fPtzhuangID,y.fPtzhuangN,y.fProjectWrokType,y.fPtzhuangState,y.fPtzhuangMasterID   from   pm_project_proceduredetail y,pm_project_persondetail2 z where 
y.fMasterID=z.fMsterID and  y.fPtzhuangID= z.fPtfMasterID and z.fTeamID LIKE '%"+ id+ "%'  and z.fTeamID  is not null and y.fPtzhuangMasterID='"+projectID+ "' and z.fWorkState ='"+st+"'";
//
System.out.println("查询桩号是sql"+sql);
//
Table table = DataUtils.queryData(conn, sql, null, null, null, null);
//遍历
Iterator<Row> iterator = table.getRows().iterator();
while (iterator.hasNext()) {
//
String uuid1 = UUID.randomUUID().toString(); //获取UUID并转化为String对象  
uuid1 = uuid1.replace("-", "");  //生成主键
System.out.println("获取到的UUID是"+uuid1);
//
Row info = iterator.next();//20171212修改计划量和实际量 3方同步
int fBasicsSubPlanSum = info.getInteger("fBasicsSubPlanSum");//基础实际量
int fTowerSubPlanSum = info.getInteger("fTowerSubPlanSum");//组塔实际量
int fStringingSubPlanSum = info.getInteger("fStringingSubPlanSum");//架线实际量
String fID = info.getString("fID");//排版桩ID
String fPtzhuangID = info.getString("fPtzhuangID");//项目桩ID   data1=data2
String fPtzhuangN = info.getString("fPtzhuangN");//桩号名称
String fType = info.getString("fProjectWrokType");//桩号类别
//插入进度桩号表
String   sql1="insert into pm_project_schedulmain1(fNo,fID,fTime,fBanCode,fMasterID,fZhuangID,fTongBuID,fZhuangName,fType,fBasicsSubPlanSum,fTowerSubPlanSum,fStringingSubPlanSum) VALUES ('"+fNo+"','"+uuid1+"','"+currentDate+"','"+id+"','"+MainID+"','"+fID+"','"+fPtzhuangID+"','"+fPtzhuangN+"','"+fType+"','"+fBasicsSubPlanSum+"','"+fTowerSubPlanSum+"','"+fStringingSubPlanSum+"')" ;
System.out.println("输出的sql是:"+sql1);
//批处理
stmt.executeUpdate(sql1);
//
System.out.println("桩号执行成功");
}
//通过人员ID 查询工序
String sql2 = "select DISTINCT n.fNo, n.fID as congbiaoID,n.fPtfID,n.fPtBasicName,n.fPtBasicType,n.fPtfMasterID, n.fMsterID,n.fTeamName,n.fTeamID,n.fWorkState,n.fToalSum,n.fPtfOnlyone from pm_project_proceduredetail m ,pm_project_persondetail2 n where m.fPtzhuangID= n.fPtfMasterID and n.fTeamID LIKE '%"+ id +"%' and n.fWorkState='"+st+"'";
//
Table table1 = DataUtils.queryData(conn,sql2, null, null, null, null);
Iterator<Row> iterator1 = table1.getRows().iterator();
//遍历插入
while (iterator1.hasNext()) {
Row info1 = iterator1.next();
//
String uuid2 = UUID.randomUUID().toString(); //获取UUID并转化为String对象  
uuid2 = uuid2.replace("-", "");  //生成主键
System.out.println("获取到的UUID是"+uuid2);
//
String congbiaoID = info1.getString("congbiaoID");//1
String fPtfID = info1.getString("fPtfID");//2
String fPtBasicName = info1.getString("fPtBasicName");//3
String fPtBasicType = info1.getString("fPtBasicType");//4
String fPtfMasterID = info1.getString("fPtfMasterID");//5
String fMsterID = info1.getString("fMsterID");//6
String fTeamName = info1.getString("fTeamName");//7
String fTeamID = info1.getString("fTeamID");//8
String fWorkState = info1.getString("fWorkState");//9
int fToalSum = info1.getInteger("fToalSum");//10
String fPtfOnlyone = info1.getString("fPtfOnlyone");//11
String fNo1 = info1.getString("fNo");//11
//插入数据 工序表
String   sqlinsert2="insert into pm_project_schedulmain2 (fNo,fID,fWritime,fBanID,fMasterID,fxmGxID,fxmwJ,fPbGXID,fPbwj,fGongxu,fBanName,fState,fWancSum,fType,fOnlyOne,fJinRiWanCheng)" +" VALUES ('"+fNo1+"','"+uuid2+"','"+currentDate+"','"+id+"','"+MainID+"','"+fPtfID+"','"+fPtfMasterID+"','"+congbiaoID+"','"+fMsterID+"','"+fPtBasicName+"','"+personName+"','"+fWorkState+"','"+fToalSum+"','"+fPtBasicType+"','"+fPtfOnlyone+"',0)" ;
System.out.println("输出的sql是:"+sqlinsert2);
//批处理
stmt.executeUpdate(sqlinsert2);
//
System.out.println("插入工序执行成功");
}




return return1;


}

public static JSONObject getJingDuNewAction1(JSONObject params,ActionContext context) throws SQLException, NamingException,java.sql.SQLException {
// 查询对应班组的工序
Connection conn = context.getConnection("jeecg");
//
JSONObject return1 =  new JSONObject();
//MainID
String id = params.getString("id");// 获取人员ID
String MainID = params.getString("MainID");// 获取人员ID
String personName = params.getString("personName");// 人员名称
String Time = params.getString("time");// 获取当前时间
String projectID = params.getString("projectID");// 获取项目名称
String fNo = "进度";
String st = "                                                    ";
//
java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());//获取sql java呼唤时间
System.out.println("获取到项目ID:" + projectID);
System.out.println("输出的" + Time);
//
//SQL批量执行
java.sql.Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
//查询排班中的所属桩号
String sql = "select  DISTINCT  y.fBasicsSubPlanSum,y.fTowerSubPlanSum,y.fStringingSubPlanSum,y.fID,y.fMasterID,y.fPtzhuangID,y.fPtzhuangN,y.fProjectWrokType,y.fPtzhuangState,y.fPtzhuangMasterID   from   pm_project_proceduredetail y,pm_project_persondetail2 z where   y.fMasterID=z.fMsterID and  y.fPtzhuangID= z.fPtfMasterID and z.fTeamID LIKE '%"+ id+ "%'  and z.fTeamID  is not null and y.fPtzhuangMasterID='"+projectID+ "' and z.fWorkState ='"+st+"'";
//
System.out.println("查询桩号是sql"+sql);
//
Table table = DataUtils.queryData(conn, sql, null, null, null, null);
//遍历
Iterator<Row> iterator = table.getRows().iterator();
while (iterator.hasNext()) {
//
String uuid1 = UUID.randomUUID().toString(); //获取UUID并转化为String对象  
uuid1 = uuid1.replace("-", "");  //生成主键
System.out.println("获取到的UUID是"+uuid1);
//
Row info = iterator.next();//20171212修改计划量和实际量 3方同步
int fBasicsSubPlanSum = info.getInteger("fBasicsSubPlanSum");//基础实际量
int fTowerSubPlanSum = info.getInteger("fTowerSubPlanSum");//组塔实际量
int fStringingSubPlanSum = info.getInteger("fStringingSubPlanSum");//架线实际量
String fID = info.getString("fID");//排版桩ID
String fPtzhuangID = info.getString("fPtzhuangID");//项目桩ID   data1=data2
String fPtzhuangN = info.getString("fPtzhuangN");//桩号名称
String fType = info.getString("fProjectWrokType");//桩号类别
//插入进度桩号表
String   sql1="insert into pm_project_schedulmain1(fNo,fID,fTime,fBanCode,fMasterID,fZhuangID,fTongBuID,fZhuangName,fType,fBasicsSubPlanSum,fTowerSubPlanSum,fStringingSubPlanSum) VALUES ('"+fNo+"','"+uuid1+"','"+currentDate+"','"+id+"','"+MainID+"','"+fID+"','"+fPtzhuangID+"','"+fPtzhuangN+"','"+fType+"','"+fBasicsSubPlanSum+"','"+fTowerSubPlanSum+"','"+fStringingSubPlanSum+"')" ;
System.out.println("输出的sql是:"+sql1);
//批处理
stmt.executeUpdate(sql1);
//
System.out.println("桩号执行成功");
}
//通过人员ID 查询工序
String sql2 = "select DISTINCT n.fNo, n.fID as congbiaoID,n.fPtfID,n.fPtBasicName,n.fPtBasicType,n.fPtfMasterID, n.fMsterID,n.fTeamName,n.fTeamID,n.fWorkState,n.fToalSum,n.fPtfOnlyone from pm_project_proceduredetail m ,pm_project_persondetail2 n where m.fPtzhuangID= n.fPtfMasterID and n.fTeamID LIKE '%"+ id +"%' and n.fWorkState='"+st+"'";
//
Table table1 = DataUtils.queryData(conn,sql2, null, null, null, null);
Iterator<Row> iterator1 = table1.getRows().iterator();
//遍历插入
while (iterator1.hasNext()) {
Row info1 = iterator1.next();
//
String uuid2 = UUID.randomUUID().toString(); //获取UUID并转化为String对象  
uuid2 = uuid2.replace("-", "");  //生成主键
System.out.println("获取到的UUID是"+uuid2);
//
String congbiaoID = info1.getString("congbiaoID");//1
String fPtfID = info1.getString("fPtfID");//2
String fPtBasicName = info1.getString("fPtBasicName");//3
String fPtBasicType = info1.getString("fPtBasicType");//4
String fPtfMasterID = info1.getString("fPtfMasterID");//5
String fMsterID = info1.getString("fMsterID");//6
String fTeamName = info1.getString("fTeamName");//7
String fTeamID = info1.getString("fTeamID");//8
String fWorkState = info1.getString("fWorkState");//9
int fToalSum = info1.getInteger("fToalSum");//10
String fPtfOnlyone = info1.getString("fPtfOnlyone");//11
String fNo1 = info1.getString("fNo");//11
//插入数据 工序表
String   sqlinsert2="insert into pm_project_schedulmain2 (fNo,fID,fWritime,fBanID,fMasterID,fxmGxID,fxmwJ,fPbGXID,fPbwj,fGongxu,fBanName,fState,fWancSum,fType,fOnlyOne,fJinRiWanCheng)" +" VALUES ('"+fNo1+"','"+uuid2+"','"+currentDate+"','"+id+"','"+MainID+"','"+fPtfID+"','"+fPtfMasterID+"','"+congbiaoID+"','"+fMsterID+"','"+fPtBasicName+"','"+personName+"','"+fWorkState+"','"+fToalSum+"','"+fPtBasicType+"','"+fPtfOnlyone+"',0)" ;
System.out.println("输出的sql是:"+sqlinsert2);
//批处理
stmt.executeUpdate(sqlinsert2);
//
System.out.println("插入工序执行成功");
}




return return1;


}

C7C68CE73B600001CF4E15001704C890 项目ID
C7C64BCA1F600001415666D317811F30  人员ID
"C7CB7A7BF02000015096170038202D60"
select  z.fPtBasicType, z.fWorkState, y.fBasicsSubPlanSum,y.fTowerSubPlanSum,y.fStringingSubPlanSum,y.fID,y.fMasterID,y.fPtzhuangID,y.fPtzhuangN,y.fProjectWrokType,y.fPtzhuangState,y.fPtzhuangMasterID  
 from   pm_project_proceduredetail y,pm_project_persondetail2 z 
where 
y.fMasterID=z.fMsterID and  y.fPtzhuangID= z.fPtfMasterID 
and z.fTeamID LIKE '%C7C64BCA1F600001415666D317811F30%'  and z.fTeamID  is not null
and y.fPtzhuangMasterID='C7C68CE73B600001CF4E15001704C890' 
and z.fWorkState ='未完成'
SELECT * FROM access_log
WHERE date BETWEEN '2016-05-10' AND '2016-05-14';
//
personID C7C64BCA1F600001415666D317811F30
C7C68CE73B600001CF4E15001704C890   projectid


select *from  pm_project_schedulmain2  m where m.fBanID='C7C64BCA1F600001415666D317811F30'
select *from pm_project_persondetail2 m where m.fTeamID='C7C64BCA1F600001415666D317811F30' and  m.fPtBasicType='组塔'


select *from pm_project_persondetail2 m where m.fTeamID='C7C64BCA1F600001415666D317811F30' and  m.fPtBasicType='基础'  and m.fWorkState='未完成'


SELECT Persons.LastName, Persons.FirstName, Orders.OrderNoFROM PersonsINNER JOIN OrdersON Persons.Id_P=Orders.Id_PORDER BY Persons.LastName//
select  DISTINCT  y.fBasicsSubPlanSum,y.fTowerSubPlanSum,y.fStringingSubPlanSum,y.fID,y.fMasterID,y.fPtzhuangID,y.fPtzhuangN,y.fProjectWrokType,y.fPtzhuangState,y.fPtzhuangMasterID   from   pm_project_proceduredetail y,pm_project_persondetail2 z where
   y.fMasterID=z.fMsterID and  y.fPtzhuangID= z.fPtfMasterID and z.fTeamID LIKE '%"+ id+ "%'  and z.fTeamID  is not null and y.fPtzhuangMasterID='"+projectID+ "' and z.fWorkState ='"+st+"'




SELECT * FROM pm_project_persondetail2 m  JOIN pm_project_proceduredetail n  ON m.fMasterID=n.fMsterID and  n.fPtzhuangID= m.fPtfMasterID and 
m.fTeamID LIKE '%C7C64BCA1F600001415666D317811F30%' and n.fPtzhuangMasterID='C7C68CE73B600001CF4E15001704C890' and n.fWorkState ='未完成'






SELECT * FROM pm_project_persondetail2 m   INNER JOIN pm_project_proceduredetail n  ON m.fMsterID=n.fMasterID and  n.fPtzhuangID= m.fPtfMasterID and 
m.fTeamID LIKE '%C7C64BCA1F600001415666D317811F30%' and n.fPtzhuangMasterID='C7C68CE73B600001CF4E15001704C890' and m.fWorkState ='未完成'




SELECT * FROM pm_project_proceduredetail  n  where n.fMasterID in ( select m.fMsterID  from pm_project_persondetail2  m where m.fTeamID LIKE '%C7C64BCA1F600001415666D317811F30%' and m.fWorkState ='未完成')   




select *from pm_project_persondetail2 m where m.fTeamID='C7C64BCA1F600001415666D317811F30'   and m.fWorkState='未完成'


if(data){                   
  




}


SELECT * FROM pm_project_proceduredetail  n  where n.fMasterID in ( select m.fMsterID  from pm_project_persondetail2  m where m.fTeamID LIKE '%C7C64BCA1F600001415666D317811F30%' and m.fWorkState ='未完成')   
and n.fPtzhuangID in( select m.fPtfMasterID  from pm_project_persondetail2  m where m.fTeamID LIKE '%C7C64BCA1F600001415666D317811F30%' and m.fWorkState ='未完成') 
and n.fPtzhuangMasterID='C7C68CE73B600001CF4E15001704C890'




SELECT * FROM pm_project_proceduredetail   n  where n.fMasterID in ( 
select m.fMsterID  from pm_project_persondetail2  m where m.fTeamID LIKE '%C7C64BCA1F600001415666D317811F30%' and m.fWorkState ='未完成')
and n.fPtzhuangMasterID='C7C68CE73B600001CF4E15001704C890'




C7C9759580100001CC9A1670C1A414F6


and m.fPtBasicType='组塔'
pm_project_proceduredetail




String sqlupOther51="update pm_project_project_postinformationtab m,pm_project_project_gongxu n 
set m.BasicsSubPageState='"+stateinged+"' where
m.fID='"+fxmwJ+"'
 AND m.fID = n.fMasterID
and n.fSum=100 
 and  n.fState='"+stateinged+"'
 and n.fBasicType='"+s1+"'";//
 
  String sqlupOther51="update pm_project_project_postinformationtab m,pm_project_project_gongxu n 
set m.BasicsSubPageState='"+stateinged+"' where
m.fID='"+fxmwJ+"'
 AND m.fID = n.fMasterID
and n.fSum=100 
 and  n.fState='"+stateinged+"'
 and n.fBasicType='"+s1+"'";//
 
 pm_project_proceduredetail
  String sqlupOther51="update pm_project_proceduredetail m,pm_project_persondetail2 n 
set m.BasicsSubPageState='"+stateinged+"' where
m.fPtzhuangID='"+fxmwJ+"'
 AND m.fPtzhuangID = n.fPtfMasterID
and n.fToalSum=100 
 and  n.fWorkState='"+stateinged+"'
 and n.fPtBasicType='"+s1+"'"; 
  String sqlupOther51="update pm_project_proceduredetail m,pm_project_persondetail2 n 
set m.BasicsSubPageState='"+stateinged+"' where
m.fPtzhuangID='"+fxmwJ+"'
 AND m.fPtzhuangID = n.fPtfMasterID
and n.fToalSum=100 
 and  n.fWorkState='"+stateinged+"'
 and n.fPtBasicType='"+s1+"'"; 
 update pm_project_project_postinformationtab  set
 BasicsSubPageState='未开始'
,TowerSubPageState='未开始' 
  , StringingSubPageState='未开始'
  , fBasicsSubPlanSum=0  
,  fTowerSubPlanSum=0
, fStringingSubPlanSum=0
 JSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].f
 JSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.valueJSON.parse(data).rows[1].fDate.value


public static   JSONObject getNewPaiBanCheckZGmess(JSONObject params, ActionContext context)throws SQLException, NamingException, java.sql.SQLException {
//排班动作
JSONObject ad = new JSONObject();
JSONArray arr = (JSONArray) params.get("id");//获取桩号ID
String  MainID = params.getString("MainsID");//获取主表ID
String  Type = params.getString("Type");//获取类型  基础组塔架线
String   ty =  "测试基础";//临时数据
String State = "未完成";
String  fNo = "3333333";
//
Date date = new Date();
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");   
java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());//获取sql java呼唤时间
//
Connection conn = context.getConnection("jeecg");// 获取数据库连接
//SQL批量执行
java.sql.Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
//
Object[] o = arr.toArray();
//
for (int i = 0; i < o.length; i++) { // 循环桩号插入表
String uuid1 = UUID.randomUUID().toString(); //获取UUID并转化为String对象  
uuid1 = uuid1.replace("-", "");  
System.out.println("第一次查询到UUID:"+ uuid1);
String id = o[i].toString();
System.out.println("获取到的id是:"+id);
// 查询桩号
/*20171211,添加功能,查询 基础实际量,组塔实际量,架线实际量,用来统计对比计划量 统计量

* */
String sql = "select m.fID,m.fPostName,m.fState,m.fMsterID,m.BasicsSubPageName,m.TowerSubPageName,m.StringingSubPageName,m.fBasicsSubPlanSum,m.fTowerSubPlanSum,m.fStringingSubPlanSum from pm_project_project_postinformationtab m  where m.fID = '"+ id + "'";
// 装入table
Table table = DataUtils.queryData(conn, sql, null, null, null, null);
// 遍历
Iterator<Row> iterator = table.getRows().iterator();
while (iterator.hasNext()) {
Row info = iterator.next();
String fID = info.getString("fID");//获取ID
String fPostName = info.getString("fPostName");//获取桩号
String fState = info.getString("fState");//获取状态
String fMsterID = info.getString("fMsterID");//获取外键
String BasicsSubPageName = info.getString("BasicsSubPageName");//获取基础分包商
String TowerSubPageName = info.getString("TowerSubPageName");//获取组塔分包商
String StringingSubPageName = info.getString("StringingSubPageName");//获取架线分包商
int fBasicsSubPlanSum = info.getInteger("fBasicsSubPlanSum");//获取基础实际量
int fTowerSubPlanSum = info.getInteger("fTowerSubPlanSum");//获取组塔实际量
int fStringingSubPlanSum = info.getInteger("fStringingSubPlanSum");//获取架线实际量
System.out.println("第一次查询到的桩号是:"+ fPostName);
//
String   sql1="insert into pm_project_proceduredetail (fNo,fID,fCreateDateTime,fMasterID,fPtzhuangID,fPtzhuangN,fProjectWrokType,fPtzhuangState,fPtzhuangMasterID,BasicsSubPageName,TowerSubPageName,StringingSubPageName,fBasicsSubPlanSumS,fTowerSubPlanSumS,fStringingSubPlanSumS,fBasicsSubPlanSum,fTowerSubPlanSum,fStringingSubPlanSum)" +
" VALUES ('"+fNo+"','"+uuid1+"','"+currentDate+"','"+MainID+"','"+fID+"','"+fPostName+"','"+Type+"','"+fState+"','"+fMsterID+"','"+BasicsSubPageName+"','"+TowerSubPageName+"','"+StringingSubPageName+"','"+fBasicsSubPlanSum+"','"+fTowerSubPlanSum+"','"+fStringingSubPlanSum+"','"+fBasicsSubPlanSum+"','"+fTowerSubPlanSum+"','"+fStringingSubPlanSum+"')" ;
System.out.println("插入排班桩号输出的sql是:"+sql1);
stmt.executeUpdate(sql1);
//
String sql2 = "select  m.fNo,m.fID,m.fMasterID,m.fBasicName,m.fBasicType, m.fOnlyone,m.fSum,m.fState from pm_project_project_gongxu m  where m.fMasterID = '"+ id + "' and m.fState='" + State + "'";
Table table1 = DataUtils.queryData(conn, sql2, null, null, null, null);
Iterator<Row> iterator1 = table1.getRows().iterator();
//遍历
while (iterator1.hasNext()) {
//生成主键
String uuid2 = UUID.randomUUID().toString(); //获取UUID并转化为String对象  
uuid2 = uuid2.replace("-", "");  
//
Row info1 = iterator1.next();
String fBasicName = info1.getString("fBasicName");
String fID1 = info1.getString("fID");
String fNo1 = info1.getString("fNo");
String fMasterID = info1.getString("fMasterID");
String fBasicType = info1.getString("fBasicType");
String fOnlyone = info1.getString("fOnlyone");
int fSum = info1.getInteger("fSum");
String fState = info1.getString("fState");
//if判断基础组塔架线
if(fBasicType.equals(Type)){
//执行插入语句pm_project_persondetail2
System.out.println("第二次查询到的工序是过滤后的工序:"+fBasicName);//
String sqlinsert1 = "insert into pm_project_persondetail2 (fNo,fID,fStartTime,fPtfID,fPtfMasterID,fPtBasicName,fPtBasicType,fPtfOnlyone,fToalSum,fWorkState,fMsterID) values ('"+fNo1+"','"+uuid2+"','"+currentDate+"','"+fID1+"','"+fMasterID+"','"+fBasicName+"','"+fBasicType+"','"+fOnlyone+"','"+fSum+"','"+fState+"','"+MainID+"')";
//批处理
stmt.executeUpdate(sqlinsert1);
System.out.println("出入工序成功"+fBasicName);
}
}  
}

//  
//批处理执行
conn.close();
return  ad;
}

String sql = "select  DISTINCT  y.fBasicsSubPlanSum,y.fTowerSubPlanSum,y.fStringingSubPlanSum,y.fID,y.fMasterID,y.fPtzhuangID,y.fPtzhuangN,y.fProjectWrokType,y.fPtzhuangState,y.fPtzhuangMasterID   from   pm_project_proceduredetail y,pm_project_persondetail2 z where   y.fMasterID=z.fMsterID and  y.fPtzhuangID= z.fPtfMasterID and z.fTeamID LIKE '%"+ id+ "%' 
and z.fTeamID  is not null and y.fPtzhuangMasterID='"+projectID+ "' and z.fWorkState ='"+st+"' and y.";



var  doc1 =bDate.toLocaleDateString();
        var  doc2 = eDate.toLocaleDateString();
        justep.Baas.sendRequest({//去查属于他的桩号
"url" : "/pm_ProjectfenBao/pm_Project_Basic_SunDay",//对应的java动作 getJingDuNewAction1
"action" : "getSundayStoom",
"async" : false,
"params" : {"start":doc1,"end":doc2}, 
"success" : function(data) {
//成功返回
debugger


}
}); 

原创粉丝点击