SjHkswwdDAOImpl.java 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. package com.huimv.sj.dao;
  2. import java.sql.SQLException;
  3. import java.util.List;
  4. import java.util.Map;
  5. import org.springframework.orm.ibatis.SqlMapClientCallback;
  6. import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
  7. import com.huimv.busi.xt.constant.XtSqlMapConstant;
  8. import com.huimv.sj.dataobject.SjHkswwd;
  9. import com.huimv.sj.dataobject.SjHkswwdExample;
  10. import com.huimv.sj.dataobject.SjWbhj;
  11. import com.ibatis.sqlmap.client.SqlMapExecutor;
  12. public class SjHkswwdDAOImpl extends SqlMapClientDaoSupport implements SjHkswwdDAO {
  13. /**
  14. * This method was generated by Apache iBATIS ibator.
  15. * This method corresponds to the database table sj_hk_sw_wd
  16. *
  17. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  18. */
  19. public SjHkswwdDAOImpl() {
  20. super();
  21. }
  22. /**
  23. * This method was generated by Apache iBATIS ibator.
  24. * This method corresponds to the database table sj_hk_sw_wd
  25. *
  26. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  27. */
  28. public int countByExample(SjHkswwdExample example) {
  29. Integer count = (Integer) getSqlMapClientTemplate().queryForObject("sj_hk_sw_wd.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_hk_sw_wd
  35. *
  36. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  37. */
  38. public int deleteByExample(SjHkswwdExample example) {
  39. int rows = getSqlMapClientTemplate().delete("sj_hk_sw_wd.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_hk_sw_wd
  45. *
  46. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  47. */
  48. public int deleteByPrimaryKey(Integer id) {
  49. SjHkswwd key = new SjHkswwd();
  50. key.setId(id);
  51. int rows = getSqlMapClientTemplate().delete("sj_hk_sw_wd.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_hk_sw_wd
  57. *
  58. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  59. */
  60. public void insert(SjHkswwd record) {
  61. getSqlMapClientTemplate().insert("sj_hk_sw_wd.ibatorgenerated_insert", record);
  62. }
  63. /**
  64. * This method was generated by Apache iBATIS ibator.
  65. * This method corresponds to the database table sj_hk_sw_wd
  66. *
  67. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  68. */
  69. public void insertSelective(SjHkswwd record) {
  70. getSqlMapClientTemplate().insert("sj_hk_sw_wd.ibatorgenerated_insertSelective", record);
  71. }
  72. /**
  73. * This method was generated by Apache iBATIS ibator.
  74. * This method corresponds to the database table sj_hk_sw_wd
  75. *
  76. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  77. */
  78. @SuppressWarnings("unchecked")
  79. public List<SjHkswwd> selectByExample(SjHkswwdExample example) {
  80. List<SjHkswwd> list = getSqlMapClientTemplate().queryForList("sj_hk_sw_wd.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_hk_sw_wd
  86. *
  87. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  88. */
  89. public SjHkswwd selectByPrimaryKey(Integer id) {
  90. SjHkswwd key = new SjHkswwd();
  91. key.setId(id);
  92. SjHkswwd record = (SjHkswwd) getSqlMapClientTemplate().queryForObject("sj_hk_sw_wd.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_hk_sw_wd
  98. *
  99. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  100. */
  101. public int updateByExampleSelective(SjHkswwd record, SjHkswwdExample example) {
  102. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  103. int rows = getSqlMapClientTemplate().update("sj_hk_sw_wd.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_hk_sw_wd
  109. *
  110. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  111. */
  112. public int updateByExample(SjHkswwd record, SjHkswwdExample example) {
  113. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  114. int rows = getSqlMapClientTemplate().update("sj_hk_sw_wd.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_hk_sw_wd
  120. *
  121. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  122. */
  123. public int updateByPrimaryKeySelective(SjHkswwd record) {
  124. int rows = getSqlMapClientTemplate().update("sj_hk_sw_wd.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_hk_sw_wd
  130. *
  131. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  132. */
  133. public int updateByPrimaryKey(SjHkswwd record) {
  134. int rows = getSqlMapClientTemplate().update("sj_hk_sw_wd.ibatorgenerated_updateByPrimaryKey", record);
  135. return rows;
  136. }
  137. /**
  138. * 查询一天环控温度
  139. * @param hm
  140. * @return
  141. */
  142. @SuppressWarnings("unchecked")
  143. public List<SjHkswwd> selectswwdByParam(Map<String, Object> param) {
  144. List<SjHkswwd> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_SWWD_BY_PARAM, param);
  145. return list;
  146. }
  147. /**
  148. * 查询全程环控温度
  149. */
  150. @SuppressWarnings("unchecked")
  151. public List<SjHkswwd> selectQcswwdByParam(Map<String, Object> param) {
  152. List<SjHkswwd> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_QCSWWD_BY_PARAM, param);
  153. return list;
  154. }
  155. /**
  156. * This class was generated by Apache iBATIS ibator.
  157. * This class corresponds to the database table sj_hk_sw_wd
  158. *
  159. * @ibatorgenerated Wed Sep 20 15:19:23 CST 2017
  160. */
  161. private static class UpdateByExampleParms extends SjHkswwdExample {
  162. private Object record;
  163. public UpdateByExampleParms(Object record, SjHkswwdExample example) {
  164. super(example);
  165. this.record = record;
  166. }
  167. public Object getRecord() {
  168. return record;
  169. }
  170. }
  171. /**
  172. * 插入环控室外温度
  173. */
  174. public void insertHkswwdByParam(List<SjHkswwd> paramMapList) {
  175. SjHkswwdSqlMapClientCallback sjHkswwdSqlMapClientCallback = new SjHkswwdSqlMapClientCallback();
  176. sjHkswwdSqlMapClientCallback.setParamMapList(paramMapList);
  177. getSqlMapClientTemplate().execute(sjHkswwdSqlMapClientCallback);
  178. }
  179. /**
  180. * 插入数据的回调类
  181. */
  182. private class SjHkswwdSqlMapClientCallback implements SqlMapClientCallback {
  183. private List<SjHkswwd> paramMapList;
  184. public void setParamMapList(List<SjHkswwd> paramMapList) {
  185. this.paramMapList = paramMapList;
  186. }
  187. @Override
  188. public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
  189. executor.startBatch();
  190. for (SjHkswwd sjHkswwd : paramMapList) {
  191. executor.insert("sj_hk_sw_wd.ibatorgenerated_insertSelective", sjHkswwd);
  192. }
  193. executor.executeBatch();
  194. return null;
  195. }
  196. }
  197. }