c0f26ebb4952c72f8e8e2d51f44c8dc841846b34.svn-base 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package com.chinacreator.process.dao;
  2. import java.sql.SQLException;
  3. import java.util.List;
  4. import org.springframework.stereotype.Component;
  5. import com.chinacreator.process.bean.SmsSendBean;
  6. import com.chinacreator.process.util.DataSource;
  7. import com.frameworkset.common.poolman.PreparedDBUtil;
  8. import com.frameworkset.common.poolman.SQLExecutor;
  9. @Component
  10. public class SmsSendDao {
  11. public void updateFlowVipSms(String id,String result) throws SQLException{
  12. String sql = "update TD_BUSSINESS_HANDLE set fvsms = ? where id =?";
  13. SQLExecutor.updateWithDBName(DataSource.NET3G, sql,result,id);
  14. }
  15. @SuppressWarnings("unchecked")
  16. public List<SmsSendBean> selectFlowVipSms() throws SQLException{
  17. String sql = "select id,userid from TD_BUSSINESS_HANDLE where to_char(effectivetime,'yyyymm') = to_char(sysdate,'yyyymm') and effectivetime>=to_date('20161108010000','yyyymmddhh24miss') and sysdate-(1/(24*60)*30) >= effectivetime and flowtime is null and viptime is null and fvsms =0 and province in(select province from TB_ACTIVITYPROVINCE_CONTROL where status =0)";
  18. PreparedDBUtil pdb = new PreparedDBUtil();
  19. try {
  20. return pdb.executeSelectForList(DataSource.NET3G, sql, 0, 500, SmsSendBean.class);
  21. } catch (SQLException e) {
  22. e.printStackTrace();
  23. }
  24. return null;
  25. }
  26. public void updateActivateSms(String id,String result) throws SQLException{
  27. String sql = "update TD_BUSSINESS_HANDLE set asms = ? where id =?";
  28. SQLExecutor.updateWithDBName(DataSource.NET3G, sql,result,id);
  29. }
  30. @SuppressWarnings("unchecked")
  31. public List<SmsSendBean> selectActivateSms() throws SQLException{
  32. String sql = "select * from TD_BUSSINESS_HANDLE where usertype =1 and activitytime>=to_date('20161108010000','yyyymmddhh24miss') and asms=0 and province in(select province from TB_ACTIVITYPROVINCE_CONTROL where status =0)";
  33. PreparedDBUtil pdb = new PreparedDBUtil();
  34. try {
  35. return pdb.executeSelectForList(DataSource.NET3G, sql, 0, 500, SmsSendBean.class);
  36. } catch (SQLException e) {
  37. e.printStackTrace();
  38. }
  39. return null;
  40. }
  41. public void updateVipSms(String id,String result) throws SQLException{
  42. String sql = "update TD_BUSSINESS_HANDLE set vsms = ? where id =?";
  43. SQLExecutor.updateWithDBName(DataSource.NET3G, sql,result,id);
  44. }
  45. @SuppressWarnings("unchecked")
  46. public List<SmsSendBean> selectVipSms() throws SQLException{
  47. String sql = "select * from TD_BUSSINESS_HANDLE where to_char(effectivetime,'yyyymm') = to_char(sysdate,'yyyymm') and effectivetime>=to_date('20161108010000','yyyymmddhh24miss') and sysdate-(1/(24*60)*30) >= effectivetime and flowtime is not null and viptime is null and vsms =0 and province in(select province from TB_ACTIVITYPROVINCE_CONTROL where status =0)";
  48. PreparedDBUtil pdb = new PreparedDBUtil();
  49. try {
  50. return pdb.executeSelectForList(DataSource.NET3G, sql, 0, 500, SmsSendBean.class);
  51. } catch (SQLException e) {
  52. e.printStackTrace();
  53. }
  54. return null;
  55. }
  56. }