12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package com.sinosoft.am.duty.records.dao;
- import java.sql.Connection;
- import java.sql.PreparedStatement;
- import java.sql.SQLException;
- import com.persistence.DbConnection;
- import com.sinosoft.em.gps.vo.GPSDutyMsg;
- import com.sinosoft.am.duty.records.service.DutyImport;
- import com.sinosoft.am.duty.records.vo.EcmDutyDetail1;
- public class DutyTaskDao {
-
-
- public boolean saveDuty(EcmDutyDetail1 detail) {
- boolean flag = false;
- DbConnection dbConn = new DbConnection();
-
- Connection conn = null;
- PreparedStatement pstm = null;
- String detailSQL = "update ECM_GPS_DUTY "
- +" set start_time = ?, end_time = ?, leader = ?, leader_tel = ?, name=?, "
- + "duty_way = ?, UPDATEDATE = ? "
- + " where FD_OBJECTID = ?";
- int num = 0 ;
- try {
- conn = dbConn.getConnection();
- conn.setAutoCommit(false);
- pstm = conn.prepareStatement(detailSQL);
- pstm.setString(1, detail.getStart_time());
- pstm.setString(2, detail.getEnd_time());
- pstm.setString(3, detail.getLeader());
- pstm.setString(4, detail.getLeader_tel());
- pstm.setString(5, detail.getName());
- pstm.setString(6, detail.getDuty_way());
- pstm.setString(7, detail.getUpdatedate());
- pstm.setString(8, detail.getFd_objectid());
- num = pstm.executeUpdate();
- conn.commit();
- flag = true;
- }catch(Exception e){
- try {
- conn.rollback();
- } catch (SQLException e1) {
- e1.printStackTrace();
- }
- e.printStackTrace();
- }finally{
- try {
- pstm.close();
- conn.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- return flag;
-
-
- }
- }
|