XxXxtzDAOImpl.java 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. package com.huimv.xx.dao;
  2. import com.huimv.busi.base.dto.ResponseBean;
  3. import com.huimv.busi.xt.constant.XtSqlMapConstant;
  4. import com.huimv.web.base.PageBean;
  5. import com.huimv.xx.dataobject.XxXxtz;
  6. import com.huimv.xx.dataobject.XxXxtzExample;
  7. import java.util.ArrayList;
  8. import java.util.List;
  9. import java.util.Map;
  10. import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
  11. public class XxXxtzDAOImpl extends SqlMapClientDaoSupport implements XxXxtzDAO {
  12. /**
  13. * This method was generated by Apache iBATIS ibator.
  14. * This method corresponds to the database table xx_xxtz
  15. *
  16. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  17. */
  18. public XxXxtzDAOImpl() {
  19. super();
  20. }
  21. /**
  22. * This method was generated by Apache iBATIS ibator.
  23. * This method corresponds to the database table xx_xxtz
  24. *
  25. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  26. */
  27. public int countByExample(XxXxtzExample example) {
  28. Integer count = (Integer) getSqlMapClientTemplate().queryForObject("xx_xxtz.ibatorgenerated_countByExample", example);
  29. return count;
  30. }
  31. /**
  32. * This method was generated by Apache iBATIS ibator.
  33. * This method corresponds to the database table xx_xxtz
  34. *
  35. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  36. */
  37. public int deleteByExample(XxXxtzExample example) {
  38. int rows = getSqlMapClientTemplate().delete("xx_xxtz.ibatorgenerated_deleteByExample", example);
  39. return rows;
  40. }
  41. /**
  42. * This method was generated by Apache iBATIS ibator.
  43. * This method corresponds to the database table xx_xxtz
  44. *
  45. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  46. */
  47. public int deleteByPrimaryKey(Integer id) {
  48. XxXxtz key = new XxXxtz();
  49. key.setId(id);
  50. int rows = getSqlMapClientTemplate().delete("xx_xxtz.ibatorgenerated_deleteByPrimaryKey", key);
  51. return rows;
  52. }
  53. /**
  54. * This method was generated by Apache iBATIS ibator.
  55. * This method corresponds to the database table xx_xxtz
  56. *
  57. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  58. */
  59. public void insert(XxXxtz record) {
  60. getSqlMapClientTemplate().insert("xx_xxtz.ibatorgenerated_insert", record);
  61. }
  62. /**
  63. * This method was generated by Apache iBATIS ibator.
  64. * This method corresponds to the database table xx_xxtz
  65. *
  66. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  67. */
  68. public void insertSelective(XxXxtz record) {
  69. getSqlMapClientTemplate().insert("xx_xxtz.ibatorgenerated_insertSelective", record);
  70. }
  71. /**
  72. * This method was generated by Apache iBATIS ibator.
  73. * This method corresponds to the database table xx_xxtz
  74. *
  75. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  76. */
  77. @SuppressWarnings("unchecked")
  78. public List<XxXxtz> selectByExampleWithBLOBs(XxXxtzExample example) {
  79. List<XxXxtz> list = getSqlMapClientTemplate().queryForList("xx_xxtz.ibatorgenerated_selectByExampleWithBLOBs", example);
  80. return list;
  81. }
  82. /**
  83. * This method was generated by Apache iBATIS ibator.
  84. * This method corresponds to the database table xx_xxtz
  85. *
  86. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  87. */
  88. @SuppressWarnings("unchecked")
  89. public List<XxXxtz> selectByExampleWithoutBLOBs(XxXxtzExample example) {
  90. List<XxXxtz> list = getSqlMapClientTemplate().queryForList("xx_xxtz.ibatorgenerated_selectByExample", example);
  91. return list;
  92. }
  93. /**
  94. * This method was generated by Apache iBATIS ibator.
  95. * This method corresponds to the database table xx_xxtz
  96. *
  97. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  98. */
  99. public XxXxtz selectByPrimaryKey(Integer id) {
  100. XxXxtz key = new XxXxtz();
  101. key.setId(id);
  102. XxXxtz record = (XxXxtz) getSqlMapClientTemplate().queryForObject("xx_xxtz.ibatorgenerated_selectByPrimaryKey", key);
  103. return record;
  104. }
  105. /**
  106. * This method was generated by Apache iBATIS ibator.
  107. * This method corresponds to the database table xx_xxtz
  108. *
  109. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  110. */
  111. public int updateByExampleSelective(XxXxtz record, XxXxtzExample example) {
  112. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  113. int rows = getSqlMapClientTemplate().update("xx_xxtz.ibatorgenerated_updateByExampleSelective", parms);
  114. return rows;
  115. }
  116. /**
  117. * This method was generated by Apache iBATIS ibator.
  118. * This method corresponds to the database table xx_xxtz
  119. *
  120. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  121. */
  122. public int updateByExampleWithBLOBs(XxXxtz record, XxXxtzExample example) {
  123. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  124. int rows = getSqlMapClientTemplate().update("xx_xxtz.ibatorgenerated_updateByExampleWithBLOBs", parms);
  125. return rows;
  126. }
  127. /**
  128. * This method was generated by Apache iBATIS ibator.
  129. * This method corresponds to the database table xx_xxtz
  130. *
  131. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  132. */
  133. public int updateByExampleWithoutBLOBs(XxXxtz record, XxXxtzExample example) {
  134. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  135. int rows = getSqlMapClientTemplate().update("xx_xxtz.ibatorgenerated_updateByExample", parms);
  136. return rows;
  137. }
  138. /**
  139. * This method was generated by Apache iBATIS ibator.
  140. * This method corresponds to the database table xx_xxtz
  141. *
  142. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  143. */
  144. public int updateByPrimaryKeySelective(XxXxtz record) {
  145. int rows = getSqlMapClientTemplate().update("xx_xxtz.ibatorgenerated_updateByPrimaryKeySelective", record);
  146. return rows;
  147. }
  148. /**
  149. * This method was generated by Apache iBATIS ibator.
  150. * This method corresponds to the database table xx_xxtz
  151. *
  152. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  153. */
  154. public int updateByPrimaryKeyWithBLOBs(XxXxtz record) {
  155. int rows = getSqlMapClientTemplate().update("xx_xxtz.ibatorgenerated_updateByPrimaryKeyWithBLOBs", record);
  156. return rows;
  157. }
  158. /**
  159. * This method was generated by Apache iBATIS ibator.
  160. * This method corresponds to the database table xx_xxtz
  161. *
  162. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  163. */
  164. public int updateByPrimaryKeyWithoutBLOBs(XxXxtz record) {
  165. int rows = getSqlMapClientTemplate().update("xx_xxtz.ibatorgenerated_updateByPrimaryKey", record);
  166. return rows;
  167. }
  168. /**
  169. * This class was generated by Apache iBATIS ibator.
  170. * This class corresponds to the database table xx_xxtz
  171. *
  172. * @ibatorgenerated Fri Aug 08 15:20:55 CST 2014
  173. */
  174. private static class UpdateByExampleParms extends XxXxtzExample {
  175. private Object record;
  176. public UpdateByExampleParms(Object record, XxXxtzExample example) {
  177. super(example);
  178. this.record = record;
  179. }
  180. @SuppressWarnings("unused")
  181. public Object getRecord() {
  182. return record;
  183. }
  184. }
  185. @SuppressWarnings("unchecked")
  186. public ResponseBean selectXxXxtzByParam(Map<String, Object> paramMap, PageBean pageBean) throws Exception {
  187. ResponseBean rb = new ResponseBean();
  188. List<XxXxtz> xxXxtzs = new ArrayList<XxXxtz>();
  189. int count = (Integer) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_COUNT_XXTZ_BY_PARAM, paramMap);
  190. if (null != pageBean) {
  191. int startRecord = pageBean.getCurrentPageFirstRecord();
  192. int endRecord = pageBean.getPageSize();
  193. paramMap.put("startRecord", startRecord);
  194. paramMap.put("endRecord", endRecord);
  195. pageBean.setRecordCount(count);
  196. } else {
  197. paramMap.put("startRecord", 0);
  198. paramMap.put("endRecord", count);
  199. }
  200. xxXxtzs = (List<XxXxtz>) getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_XXTZ_BY_PARAM, paramMap);
  201. rb.setResult(xxXxtzs);
  202. rb.setReturnCode(count);
  203. return rb;
  204. }
  205. public int getXxXxtzMaxId() {
  206. Integer maxId = (Integer) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_GET_XXTZ_MAX_ID);
  207. if(maxId == null) {
  208. maxId = 0;
  209. }
  210. return maxId;
  211. }
  212. /**
  213. * 获取发布时间合适的XtXxtz
  214. */
  215. @SuppressWarnings("unchecked")
  216. public List<XxXxtz> selectXtXxtzFitTime(Map<String, Object> paramMap) {
  217. return (List<XxXxtz>) getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_XXTZ_FIT_TIME, paramMap);
  218. }
  219. }