3efc86edeed64465093086f9e8dbc9503f4537fc.svn-base 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package com.chinacreator.process.dao;
  2. import com.chinacreator.process.bean.BoYuanBean;
  3. import com.chinacreator.process.bean.BoYuanLogBean;
  4. import com.chinacreator.process.util.DataSource;
  5. import com.frameworkset.common.poolman.SQLExecutor;
  6. import org.springframework.stereotype.Component;
  7. import java.sql.SQLException;
  8. import java.util.List;
  9. import java.util.Map;
  10. @Component
  11. public class BoYuanSyncDao {
  12. // public List<Map> findSyncData() throws SQLException {
  13. // String sql="select t.* ,s.PRICE from TD_BAOYUAN_SYNC_ORDER t join tb_sp_info s on t.spid=s.spid where STATUS in ('1','3') and SYNCCNT<3 and rownum < 100";
  14. // return SQLExecutor.queryListWithDBName(Map.class,DataSource.NET3G,sql);
  15. //
  16. // }
  17. public List<BoYuanBean> findSyncData() throws SQLException {
  18. String sql="select t.* ,s.PRICE from TD_BAOYUAN_SYNC_ORDER t join tb_sp_info s on t.spid=s.spid " +
  19. "where STATUS in ('1','3') and SYNCCNT<4 and rownum < 100";
  20. return SQLExecutor.queryListWithDBName(BoYuanBean.class,DataSource.NET3G,sql);
  21. }
  22. /**
  23. * 修改主表数据
  24. * @param bean
  25. * @throws SQLException
  26. */
  27. public void updateBoYuan(BoYuanBean bean) throws SQLException {
  28. String sql="update TD_BAOYUAN_SYNC_ORDER t set t.SYNCTIME=to_date(#[synctime],'yyyymmddhh24miss')," +
  29. "t.status=#[status], t.synccnt=t.synccnt+1,t.inputparams=#[inputparams], " +
  30. "t.outparams=#[outparams] where t.id=#[id] ";
  31. SQLExecutor.updateBean(DataSource.NET3G,sql,bean);
  32. }
  33. public void insertBoYuanLogBean(BoYuanLogBean bean) throws SQLException {
  34. String sql="insert into TL_BAOYUAN_SYNC_ORDER_LOG(id,syncid,userid,cpid,spid,type,synctime,inputtime," +
  35. "inputparams,outparams,inputparamsback) " +
  36. " values(to_char(sysdate,'yyyyMMddhh24miss')||SEQ_COMMON6.nextval,#[syncid],#[userid],#[cpid], " +
  37. " #[spid],#[type],to_date(#[synctime],'yyyymmddhh24miss'),to_date(#[inputtime],'yyyymmddhh24miss')," +
  38. "#[inputparams],#[outparams],#[inputparamsback])";
  39. SQLExecutor.insertBean(DataSource.NET3G, sql, bean);
  40. }
  41. }