SjWbhjDAOImpl.java 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. package com.huimv.sj.dao;
  2. import java.sql.SQLException;
  3. import java.util.Date;
  4. import java.util.List;
  5. import java.util.Map;
  6. import org.springframework.orm.ibatis.SqlMapClientCallback;
  7. import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
  8. import com.huimv.busi.xt.constant.XtSqlMapConstant;
  9. import com.huimv.sj.dataobject.SjWbhj;
  10. import com.huimv.sj.dataobject.SjWbhjExample;
  11. import com.ibatis.sqlmap.client.SqlMapExecutor;
  12. public class SjWbhjDAOImpl extends SqlMapClientDaoSupport implements SjWbhjDAO {
  13. /**
  14. * This method was generated by Apache iBATIS ibator.
  15. * This method corresponds to the database table sj_wbhj
  16. *
  17. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  18. */
  19. public SjWbhjDAOImpl() {
  20. super();
  21. }
  22. /**
  23. * This method was generated by Apache iBATIS ibator.
  24. * This method corresponds to the database table sj_wbhj
  25. *
  26. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  27. */
  28. public int countByExample(SjWbhjExample example) {
  29. Integer count = (Integer) getSqlMapClientTemplate().queryForObject("sj_wbhj.ibatorgenerated_countByExample", example);
  30. return count;
  31. }
  32. /**
  33. * This method was generated by Apache iBATIS ibator.
  34. * This method corresponds to the database table sj_wbhj
  35. *
  36. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  37. */
  38. public int deleteByExample(SjWbhjExample example) {
  39. int rows = getSqlMapClientTemplate().delete("sj_wbhj.ibatorgenerated_deleteByExample", example);
  40. return rows;
  41. }
  42. /**
  43. * This method was generated by Apache iBATIS ibator.
  44. * This method corresponds to the database table sj_wbhj
  45. *
  46. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  47. */
  48. public int deleteByPrimaryKey(Integer id) {
  49. SjWbhj key = new SjWbhj();
  50. key.setId(id);
  51. int rows = getSqlMapClientTemplate().delete("sj_wbhj.ibatorgenerated_deleteByPrimaryKey", key);
  52. return rows;
  53. }
  54. /**
  55. * This method was generated by Apache iBATIS ibator.
  56. * This method corresponds to the database table sj_wbhj
  57. *
  58. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  59. */
  60. public void insert(SjWbhj record) {
  61. getSqlMapClientTemplate().insert("sj_wbhj.ibatorgenerated_insert", record);
  62. }
  63. /**
  64. * This method was generated by Apache iBATIS ibator.
  65. * This method corresponds to the database table sj_wbhj
  66. *
  67. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  68. */
  69. public void insertSelective(SjWbhj record) {
  70. getSqlMapClientTemplate().insert("sj_wbhj.ibatorgenerated_insertSelective", record);
  71. }
  72. /**
  73. * This method was generated by Apache iBATIS ibator.
  74. * This method corresponds to the database table sj_wbhj
  75. *
  76. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  77. */
  78. @SuppressWarnings("unchecked")
  79. public List<SjWbhj> selectByExample(SjWbhjExample example) {
  80. List<SjWbhj> list = getSqlMapClientTemplate().queryForList("sj_wbhj.ibatorgenerated_selectByExample", example);
  81. return list;
  82. }
  83. /**
  84. * This method was generated by Apache iBATIS ibator.
  85. * This method corresponds to the database table sj_wbhj
  86. *
  87. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  88. */
  89. public SjWbhj selectByPrimaryKey(Integer id) {
  90. SjWbhj key = new SjWbhj();
  91. key.setId(id);
  92. SjWbhj record = (SjWbhj) getSqlMapClientTemplate().queryForObject("sj_wbhj.ibatorgenerated_selectByPrimaryKey", key);
  93. return record;
  94. }
  95. /**
  96. * This method was generated by Apache iBATIS ibator.
  97. * This method corresponds to the database table sj_wbhj
  98. *
  99. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  100. */
  101. public int updateByExampleSelective(SjWbhj record, SjWbhjExample example) {
  102. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  103. int rows = getSqlMapClientTemplate().update("sj_wbhj.ibatorgenerated_updateByExampleSelective", parms);
  104. return rows;
  105. }
  106. /**
  107. * This method was generated by Apache iBATIS ibator.
  108. * This method corresponds to the database table sj_wbhj
  109. *
  110. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  111. */
  112. public int updateByExample(SjWbhj record, SjWbhjExample example) {
  113. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  114. int rows = getSqlMapClientTemplate().update("sj_wbhj.ibatorgenerated_updateByExample", parms);
  115. return rows;
  116. }
  117. /**
  118. * This method was generated by Apache iBATIS ibator.
  119. * This method corresponds to the database table sj_wbhj
  120. *
  121. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  122. */
  123. public int updateByPrimaryKeySelective(SjWbhj record) {
  124. int rows = getSqlMapClientTemplate().update("sj_wbhj.ibatorgenerated_updateByPrimaryKeySelective", record);
  125. return rows;
  126. }
  127. /**
  128. * This method was generated by Apache iBATIS ibator.
  129. * This method corresponds to the database table sj_wbhj
  130. *
  131. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  132. */
  133. public int updateByPrimaryKey(SjWbhj record) {
  134. int rows = getSqlMapClientTemplate().update("sj_wbhj.ibatorgenerated_updateByPrimaryKey", record);
  135. return rows;
  136. }
  137. /**
  138. * This class was generated by Apache iBATIS ibator.
  139. * This class corresponds to the database table sj_wbhj
  140. *
  141. * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015
  142. */
  143. private static class UpdateByExampleParms extends SjWbhjExample {
  144. private Object record;
  145. public UpdateByExampleParms(Object record, SjWbhjExample example) {
  146. super(example);
  147. this.record = record;
  148. }
  149. @SuppressWarnings("unused")
  150. public Object getRecord() {
  151. return record;
  152. }
  153. }
  154. public Date selectMaxtimeByParam(Map<String, Object> param) {
  155. Date date = (Date) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_MAXTIME_BY_PARAM, param);
  156. return date;
  157. }
  158. @Override
  159. public void insertWbhjListByParam(List<Map<String, Object>> paramMapList) {
  160. WbhjListSqlMapClientCallback wbhjListSqlMapClientCallback = new WbhjListSqlMapClientCallback();
  161. wbhjListSqlMapClientCallback.setParamMapList(paramMapList);
  162. getSqlMapClientTemplate().execute(wbhjListSqlMapClientCallback);
  163. }
  164. /**
  165. * 插入数据的回调类
  166. */
  167. private class WbhjListSqlMapClientCallback implements SqlMapClientCallback {
  168. private List<Map<String, Object>> paramMapList;
  169. public void setParamMapList(List<Map<String, Object>> paramMapList) {
  170. this.paramMapList = paramMapList;
  171. }
  172. @Override
  173. public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
  174. executor.startBatch();
  175. for (Map<String, Object> paramMap : paramMapList) {
  176. executor.insert(XtSqlMapConstant.SQLMAP_INSERT_WBHJLIST_BY_PARAM, paramMap);
  177. }
  178. executor.executeBatch();
  179. return null;
  180. }
  181. }
  182. /**
  183. * 查询一天环控温度
  184. * @param hm
  185. * @return
  186. */
  187. @SuppressWarnings("unchecked")
  188. public List<SjWbhj> selectWbhjWdByParam(Map<String, Object> param) {
  189. List<SjWbhj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_WD_BY_PARAM, param);
  190. return list;
  191. }
  192. /**
  193. * 查询一天环控湿度
  194. * @param hm
  195. * @return
  196. */
  197. @SuppressWarnings("unchecked")
  198. public List<SjWbhj> selectWbhjSdByParam(Map<String, Object> param) {
  199. List<SjWbhj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_SD_BY_PARAM, param);
  200. return list;
  201. }
  202. /**
  203. * 查询全程环控温度
  204. */
  205. @SuppressWarnings("unchecked")
  206. public List<SjWbhj> selectWbhjQcwdByParam(Map<String, Object> param) {
  207. List<SjWbhj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_QCWD_BY_PARAM, param);
  208. return list;
  209. }
  210. /**
  211. * 查询全程环控湿度
  212. */
  213. @SuppressWarnings("unchecked")
  214. public List<SjWbhj> selectWbhjQcsdByParam(Map<String, Object> param) {
  215. List<SjWbhj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_QCSD_BY_PARAM, param);
  216. return list;
  217. }
  218. }