public int deleteReward(long rid) throws DaoException { String sql = "delete from t01_rewarded_exp where rid = ?"; if (logger.isDebugEnabled()) { logger.debug("**sql:" + sql); logger.debug("**id:" + rid); } IDao dao = DaoFactory.createDaoInstance(); return dao.update("ijsp", sql, rid); }
public T01RewardExp getReward(long rid) throws DaoException { String sql = "select * from t01_rewarded_exp where rid=?"; if (logger.isDebugEnabled()) { logger.debug("**sql:" + sql); logger.debug("**id:" + rid); } IDao dao = DaoFactory.createDaoInstance(); return dao.queryUniq("ijsp", sql, T01RewardExp.class, rid); }
public int getRewardCount(int rSid) throws DaoException { String sql = "select count(1) from t01_rewarded_exp where rSid = " + rSid; IDao dao = DaoFactory.createDaoInstance(); int count = dao.queryCount("ijsp", sql); if (logger.isDebugEnabled()) { logger.debug("**sql:" + sql); logger.debug("**count:" + count); } return count; }
public List<T01RewardExp> listReward(int start, int length, int rSid) throws DaoException { String sql = "select * from t01_rewarded_exp where rSid = ? limit ?,?"; logger.debug("**sql:" + sql); logger.debug("**rSid:" + rSid); logger.debug("**start:" + start); logger.debug("**length:" + length); IDao dao = DaoFactory.createDaoInstance(); List<T01RewardExp> list = dao.query("ijsp", sql, T01RewardExp.class, new Object[] {rSid, start, length}); return list; }
public int addReward(T01RewardExp t01RewardExp) throws DaoException { String sql = "insert into t01_rewarded_exp values (null,?,?,?,?)"; if (logger.isDebugEnabled()) { logger.debug("**sql:" + sql); logger.debug("**rid:" + t01RewardExp); } IDao dao = DaoFactory.createDaoInstance(); return dao.update( "ijsp", sql, new Object[] { t01RewardExp.getRSid(), t01RewardExp.getRewardName(), t01RewardExp.getRewardTime(), t01RewardExp.getOrganization() }); }
public int updateReward(T01RewardExp t01RewardExp) throws DaoException { String sql = "update t01_rewarded_exp set rewardName=?, rewardTime=?,organization=? where rid = ?"; if (logger.isDebugEnabled()) { logger.debug("**sql:" + sql); logger.debug("**rid:" + t01RewardExp); } IDao dao = DaoFactory.createDaoInstance(); return dao.update( "ijsp", sql, new Object[] { t01RewardExp.getRewardName(), t01RewardExp.getRewardTime(), t01RewardExp.getOrganization(), t01RewardExp.getRid() }); }