DaZsjkDAOImpl.java 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. package com.huimv.da.dao;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import java.util.Map;
  5. import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
  6. import com.huimv.busi.base.dto.ResponseBean;
  7. import com.huimv.busi.xt.constant.XtSqlMapConstant;
  8. import com.huimv.da.dataobject.DaZsjk;
  9. import com.huimv.da.dataobject.DaZsjkExample;
  10. import com.huimv.web.base.PageBean;
  11. public class DaZsjkDAOImpl extends SqlMapClientDaoSupport implements DaZsjkDAO {
  12. /**
  13. * This method was generated by Apache iBATIS ibator.
  14. * This method corresponds to the database table da_zsjk
  15. *
  16. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  17. */
  18. public DaZsjkDAOImpl() {
  19. super();
  20. }
  21. /**
  22. * This method was generated by Apache iBATIS ibator.
  23. * This method corresponds to the database table da_zsjk
  24. *
  25. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  26. */
  27. public int countByExample(DaZsjkExample example) {
  28. Integer count = (Integer) getSqlMapClientTemplate().queryForObject("da_zsjk.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 da_zsjk
  34. *
  35. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  36. */
  37. public int deleteByExample(DaZsjkExample example) {
  38. int rows = getSqlMapClientTemplate().delete("da_zsjk.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 da_zsjk
  44. *
  45. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  46. */
  47. public int deleteByPrimaryKey(Integer id) {
  48. DaZsjk key = new DaZsjk();
  49. key.setId(id);
  50. int rows = getSqlMapClientTemplate().delete("da_zsjk.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 da_zsjk
  56. *
  57. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  58. */
  59. public void insert(DaZsjk record) {
  60. getSqlMapClientTemplate().insert("da_zsjk.ibatorgenerated_insert", record);
  61. }
  62. /**
  63. * This method was generated by Apache iBATIS ibator.
  64. * This method corresponds to the database table da_zsjk
  65. *
  66. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  67. */
  68. public void insertSelective(DaZsjk record) {
  69. getSqlMapClientTemplate().insert("da_zsjk.ibatorgenerated_insertSelective", record);
  70. }
  71. /**
  72. * This method was generated by Apache iBATIS ibator.
  73. * This method corresponds to the database table da_zsjk
  74. *
  75. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  76. */
  77. @SuppressWarnings("unchecked")
  78. public List<DaZsjk> selectByExample(DaZsjkExample example) {
  79. List<DaZsjk> list = getSqlMapClientTemplate().queryForList("da_zsjk.ibatorgenerated_selectByExample", example);
  80. return list;
  81. }
  82. /**
  83. * This method was generated by Apache iBATIS ibator.
  84. * This method corresponds to the database table da_zsjk
  85. *
  86. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  87. */
  88. public DaZsjk selectByPrimaryKey(Integer id) {
  89. DaZsjk key = new DaZsjk();
  90. key.setId(id);
  91. DaZsjk record = (DaZsjk) getSqlMapClientTemplate().queryForObject("da_zsjk.ibatorgenerated_selectByPrimaryKey", key);
  92. return record;
  93. }
  94. /**
  95. * This method was generated by Apache iBATIS ibator.
  96. * This method corresponds to the database table da_zsjk
  97. *
  98. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  99. */
  100. public int updateByExampleSelective(DaZsjk record, DaZsjkExample example) {
  101. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  102. int rows = getSqlMapClientTemplate().update("da_zsjk.ibatorgenerated_updateByExampleSelective", parms);
  103. return rows;
  104. }
  105. /**
  106. * This method was generated by Apache iBATIS ibator.
  107. * This method corresponds to the database table da_zsjk
  108. *
  109. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  110. */
  111. public int updateByExample(DaZsjk record, DaZsjkExample example) {
  112. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  113. int rows = getSqlMapClientTemplate().update("da_zsjk.ibatorgenerated_updateByExample", parms);
  114. return rows;
  115. }
  116. /**
  117. * This method was generated by Apache iBATIS ibator.
  118. * This method corresponds to the database table da_zsjk
  119. *
  120. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  121. */
  122. public int updateByPrimaryKeySelective(DaZsjk record) {
  123. int rows = getSqlMapClientTemplate().update("da_zsjk.ibatorgenerated_updateByPrimaryKeySelective", record);
  124. return rows;
  125. }
  126. /**
  127. * This method was generated by Apache iBATIS ibator.
  128. * This method corresponds to the database table da_zsjk
  129. *
  130. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  131. */
  132. public int updateByPrimaryKey(DaZsjk record) {
  133. int rows = getSqlMapClientTemplate().update("da_zsjk.ibatorgenerated_updateByPrimaryKey", record);
  134. return rows;
  135. }
  136. /**
  137. * This class was generated by Apache iBATIS ibator.
  138. * This class corresponds to the database table da_zsjk
  139. *
  140. * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015
  141. */
  142. private static class UpdateByExampleParms extends DaZsjkExample {
  143. private Object record;
  144. public UpdateByExampleParms(Object record, DaZsjkExample example) {
  145. super(example);
  146. this.record = record;
  147. }
  148. @SuppressWarnings("unused")
  149. public Object getRecord() {
  150. return record;
  151. }
  152. }
  153. /**
  154. * 根据参数获取猪舍监控
  155. *
  156. * @param paramMap
  157. * @param pageBean
  158. * @return
  159. * @throws Exception
  160. */
  161. @SuppressWarnings("unchecked")
  162. public ResponseBean getZsjkByParam(Map<String, Object> paramMap, PageBean pageBean) throws Exception {
  163. ResponseBean rb = new ResponseBean();
  164. List<DaZsjk> zsjkList = new ArrayList<DaZsjk>();
  165. int count = (Integer) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_COUNT_ZSJK_BY_PARAM, paramMap);
  166. if (null != pageBean) {
  167. int startRecord = pageBean.getCurrentPageFirstRecord();
  168. int endRecord = pageBean.getPageSize();
  169. paramMap.put("startRecord", startRecord);
  170. paramMap.put("endRecord", endRecord);
  171. zsjkList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_ZSJK_BY_PARAM, paramMap);
  172. pageBean.setRecordCount(count);
  173. } else {
  174. paramMap.put("startRecord", 0);
  175. paramMap.put("endRecord", count);
  176. zsjkList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_ZSJK_BY_PARAM, paramMap);
  177. }
  178. rb.setResult(zsjkList);
  179. rb.setReturnCode(count);
  180. return rb;
  181. }
  182. /**
  183. * 根据栏期获取猪舍监控
  184. *
  185. * @param paramMap
  186. * @param pageBean
  187. * @return
  188. * @throws Exception
  189. */
  190. @SuppressWarnings("unchecked")
  191. public ResponseBean getZsjkBylqid(Map<String, Object> paramMap) throws Exception {
  192. ResponseBean rb = new ResponseBean();
  193. List<DaZsjk> zsjkList = new ArrayList<DaZsjk>();
  194. int count = (Integer) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_COUNT_ZSJK_BY_LQID, paramMap);
  195. paramMap.put("startRecord", 0);
  196. paramMap.put("endRecord", count);
  197. zsjkList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_ZSJK_BY_LQID, paramMap);
  198. rb.setResult(zsjkList);
  199. rb.setReturnCode(count);
  200. return rb;
  201. }
  202. /**
  203. * 根据ID获取档案
  204. *
  205. * @param paramMap
  206. * @return
  207. * @throws Exception
  208. */
  209. public DaZsjk getZsjkById(Map<String, Object> paramMap) throws Exception {
  210. paramMap.put("startRecord", 0);
  211. paramMap.put("endRecord", 1);
  212. DaZsjk zsjk = (DaZsjk) getSqlMapClientTemplate().queryForObject(
  213. XtSqlMapConstant.SQLMAP_SELECT_ZSJK_BY_PARAM, paramMap);
  214. return zsjk;
  215. }
  216. }