02f2118badc0af91156d52108cd996da43739d27.svn-base 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package com.chinacreator.process.dao;
  2. import java.sql.SQLException;
  3. import java.util.List;
  4. import org.apache.commons.lang.math.NumberUtils;
  5. import org.apache.log4j.Logger;
  6. import org.springframework.stereotype.Component;
  7. import com.chinacreator.process.util.DataSource;
  8. import com.frameworkset.common.poolman.PreparedDBUtil;
  9. import com.frameworkset.common.poolman.SQLExecutor;
  10. @Component
  11. public class ActiveMango3JSDao{
  12. private static Logger logger = Logger.getLogger(ActiveMango3JSDao.class);
  13. @SuppressWarnings("unchecked")
  14. public List<String> queryNeedSmsDeal(){
  15. String sql = " select userid from TD_BUSSINESS_HANDLE_MANGO3JS where inserttime>=sysdate-10 and inserttime<sysdate-3 and smsstatus='1' ";
  16. PreparedDBUtil pdb = new PreparedDBUtil();
  17. try {
  18. return pdb.executeSelectForList("net3g", sql, 0L, 500, String.class);
  19. } catch (Exception e) {
  20. logger.error("查询需要发短信处理的数据失败", e);
  21. }
  22. return null;
  23. }
  24. public void sendSmsSuccess(String userid) {
  25. String sql = "update net3g.TD_BUSSINESS_HANDLE_MANGO3JS set smsstatus='0',smstime=sysdate where userid=?";
  26. try {
  27. SQLExecutor.updateWithDBName("net3g", sql, new Object[] { userid });
  28. } catch (SQLException e) {
  29. logger.error("更改TB_USERID_FAKEID失败", e);
  30. }
  31. }
  32. public void sendSmsfail(String userid) {
  33. String sql = "update net3g.TD_BUSSINESS_HANDLE_MANGO3JS set smsstatus='2',smstime=sysdate where userid=?";
  34. try {
  35. SQLExecutor.updateWithDBName("net3g", sql, new Object[] { userid });
  36. } catch (SQLException e) {
  37. logger.error("更改TB_USERID_FAKEID失败", e);
  38. }
  39. }
  40. public void sendSmsNot(String userid) {
  41. String sql = "update net3g.TD_BUSSINESS_HANDLE_MANGO3JS set smsstatus='3',smstime=sysdate where userid=?";
  42. try {
  43. SQLExecutor.updateWithDBName("net3g", sql, new Object[] { userid });
  44. } catch (SQLException e) {
  45. logger.error("更改TB_USERID_FAKEID失败", e);
  46. }
  47. }
  48. public void sendSmsExeception(String userid) {
  49. String sql = "update net3g.TD_BUSSINESS_HANDLE_MANGO3JS set smsstatus='4',smstime=sysdate where userid=?";
  50. try {
  51. SQLExecutor.updateWithDBName("net3g", sql, new Object[] { userid });
  52. } catch (SQLException e) {
  53. logger.error("更改TB_USERID_FAKEID失败", e);
  54. }
  55. }
  56. public boolean queryOrderRelation16(String userid) throws SQLException{
  57. String sql = "select count(1) totals from TD_ORDER_RELATIONS where userid =? and cpid ='mangtv16' and spid='1006' and status='0'";
  58. return NumberUtils.toInt(SQLExecutor.queryFieldWithDBName(DataSource.NET3G, sql, userid))>0;
  59. }
  60. }