SjHkeyhtDAOImpl.java 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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.busi.xt.utils.DynamicDataSourceHolder;
  9. import com.huimv.sj.dataobject.SjHkeyht;
  10. import com.huimv.sj.dataobject.SjHkeyht;
  11. import com.huimv.sj.dataobject.SjHkeyhtExample;
  12. import com.ibatis.sqlmap.client.SqlMapExecutor;
  13. public class SjHkeyhtDAOImpl extends SqlMapClientDaoSupport implements SjHkeyhtDAO {
  14. /**
  15. * This method was generated by Apache iBATIS ibator.
  16. * This method corresponds to the database table sj_hk_eyht
  17. *
  18. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  19. */
  20. public SjHkeyhtDAOImpl() {
  21. super();
  22. }
  23. /**
  24. * This method was generated by Apache iBATIS ibator.
  25. * This method corresponds to the database table sj_hk_eyht
  26. *
  27. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  28. */
  29. public int countByExample(SjHkeyhtExample example) {
  30. Integer count = (Integer) getSqlMapClientTemplate().queryForObject("sj_hk_eyht.ibatorgenerated_countByExample", example);
  31. return count;
  32. }
  33. /**
  34. * This method was generated by Apache iBATIS ibator.
  35. * This method corresponds to the database table sj_hk_eyht
  36. *
  37. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  38. */
  39. public int deleteByExample(SjHkeyhtExample example) {
  40. int rows = getSqlMapClientTemplate().delete("sj_hk_eyht.ibatorgenerated_deleteByExample", example);
  41. return rows;
  42. }
  43. /**
  44. * This method was generated by Apache iBATIS ibator.
  45. * This method corresponds to the database table sj_hk_eyht
  46. *
  47. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  48. */
  49. public int deleteByPrimaryKey(Integer id) {
  50. SjHkeyht key = new SjHkeyht();
  51. key.setId(id);
  52. int rows = getSqlMapClientTemplate().delete("sj_hk_eyht.ibatorgenerated_deleteByPrimaryKey", key);
  53. return rows;
  54. }
  55. /**
  56. * This method was generated by Apache iBATIS ibator.
  57. * This method corresponds to the database table sj_hk_eyht
  58. *
  59. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  60. */
  61. public void insert(SjHkeyht record) {
  62. getSqlMapClientTemplate().insert("sj_hk_eyht.ibatorgenerated_insert", record);
  63. }
  64. /**
  65. * This method was generated by Apache iBATIS ibator.
  66. * This method corresponds to the database table sj_hk_eyht
  67. *
  68. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  69. */
  70. public void insertSelective(SjHkeyht record) {
  71. getSqlMapClientTemplate().insert("sj_hk_eyht.ibatorgenerated_insertSelective", record);
  72. }
  73. /**
  74. * This method was generated by Apache iBATIS ibator.
  75. * This method corresponds to the database table sj_hk_eyht
  76. *
  77. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  78. */
  79. @SuppressWarnings("unchecked")
  80. public List<SjHkeyht> selectByExample(SjHkeyhtExample example) {
  81. List<SjHkeyht> list = getSqlMapClientTemplate().queryForList("sj_hk_eyht.ibatorgenerated_selectByExample", example);
  82. return list;
  83. }
  84. /**
  85. * This method was generated by Apache iBATIS ibator.
  86. * This method corresponds to the database table sj_hk_eyht
  87. *
  88. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  89. */
  90. public SjHkeyht selectByPrimaryKey(Integer id) {
  91. SjHkeyht key = new SjHkeyht();
  92. key.setId(id);
  93. SjHkeyht record = (SjHkeyht) getSqlMapClientTemplate().queryForObject("sj_hk_eyht.ibatorgenerated_selectByPrimaryKey", key);
  94. return record;
  95. }
  96. /**
  97. * This method was generated by Apache iBATIS ibator.
  98. * This method corresponds to the database table sj_hk_eyht
  99. *
  100. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  101. */
  102. public int updateByExampleSelective(SjHkeyht record, SjHkeyhtExample example) {
  103. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  104. int rows = getSqlMapClientTemplate().update("sj_hk_eyht.ibatorgenerated_updateByExampleSelective", parms);
  105. return rows;
  106. }
  107. /**
  108. * This method was generated by Apache iBATIS ibator.
  109. * This method corresponds to the database table sj_hk_eyht
  110. *
  111. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  112. */
  113. public int updateByExample(SjHkeyht record, SjHkeyhtExample example) {
  114. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  115. int rows = getSqlMapClientTemplate().update("sj_hk_eyht.ibatorgenerated_updateByExample", parms);
  116. return rows;
  117. }
  118. /**
  119. * This method was generated by Apache iBATIS ibator.
  120. * This method corresponds to the database table sj_hk_eyht
  121. *
  122. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  123. */
  124. public int updateByPrimaryKeySelective(SjHkeyht record) {
  125. int rows = getSqlMapClientTemplate().update("sj_hk_eyht.ibatorgenerated_updateByPrimaryKeySelective", record);
  126. return rows;
  127. }
  128. /**
  129. * This method was generated by Apache iBATIS ibator.
  130. * This method corresponds to the database table sj_hk_eyht
  131. *
  132. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  133. */
  134. public int updateByPrimaryKey(SjHkeyht record) {
  135. int rows = getSqlMapClientTemplate().update("sj_hk_eyht.ibatorgenerated_updateByPrimaryKey", record);
  136. return rows;
  137. }
  138. /**
  139. * This class was generated by Apache iBATIS ibator.
  140. * This class corresponds to the database table sj_hk_eyht
  141. *
  142. * @ibatorgenerated Wed Sep 20 15:18:45 CST 2017
  143. */
  144. private static class UpdateByExampleParms extends SjHkeyhtExample {
  145. private Object record;
  146. public UpdateByExampleParms(Object record, SjHkeyhtExample example) {
  147. super(example);
  148. this.record = record;
  149. }
  150. public Object getRecord() {
  151. return record;
  152. }
  153. }
  154. /**
  155. * 插入环控二氧化碳
  156. */
  157. public void insertHkeyhtByParam(List<SjHkeyht> paramMapList) {
  158. SjHkeyhtSqlMapClientCallback sjHkeyhtSqlMapClientCallback = new SjHkeyhtSqlMapClientCallback();
  159. sjHkeyhtSqlMapClientCallback.setParamMapList(paramMapList);
  160. getSqlMapClientTemplate().execute(sjHkeyhtSqlMapClientCallback);
  161. }
  162. /**
  163. * 插入数据的回调类
  164. */
  165. private class SjHkeyhtSqlMapClientCallback implements SqlMapClientCallback {
  166. private List<SjHkeyht> paramMapList;
  167. public void setParamMapList(List<SjHkeyht> paramMapList) {
  168. this.paramMapList = paramMapList;
  169. }
  170. @Override
  171. public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
  172. executor.startBatch();
  173. for (SjHkeyht sjHkeyht : paramMapList) {
  174. executor.insert("sj_hk_eyht.ibatorgenerated_insertSelective", sjHkeyht);
  175. }
  176. executor.executeBatch();
  177. return null;
  178. }
  179. }
  180. @SuppressWarnings("unchecked")
  181. public List<SjHkeyht> selectQceyhtByParam(Map<String, Object> searchParam) {
  182. DynamicDataSourceHolder.setRouteKey("");
  183. List<SjHkeyht> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_QCHKEYHT_BY_PARAM, searchParam);
  184. DynamicDataSourceHolder.removeRouteKey();
  185. return list;
  186. }
  187. @SuppressWarnings("unchecked")
  188. public List<SjHkeyht> selectDqeyhtByParam(Map<String, Object> searchParam) {
  189. DynamicDataSourceHolder.setRouteKey("");
  190. List<SjHkeyht> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_DQHKEYHT_BY_PARAM, searchParam);
  191. DynamicDataSourceHolder.removeRouteKey();
  192. return list;
  193. }
  194. @SuppressWarnings("unchecked")
  195. public List<SjHkeyht> selectHkeyhtCgqidByParam(Map<String, Object> searchParam) {
  196. DynamicDataSourceHolder.setRouteKey("");
  197. List<SjHkeyht> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_HKEYHT_CGQID_BY_PARAM, searchParam);
  198. DynamicDataSourceHolder.removeRouteKey();
  199. return list;
  200. }
  201. }