XtFlzbjgzxxDAOImpl.java 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. package com.huimv.xt.dao;
  2. import java.sql.SQLException;
  3. import java.util.List;
  4. import org.springframework.orm.ibatis.SqlMapClientCallback;
  5. import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
  6. import com.huimv.xt.dataobject.XtFlzbjgzxx;
  7. import com.huimv.xt.dataobject.XtFlzbjgzxxExample;
  8. import com.ibatis.sqlmap.client.SqlMapExecutor;
  9. public class XtFlzbjgzxxDAOImpl extends SqlMapClientDaoSupport implements XtFlzbjgzxxDAO {
  10. /**
  11. * This method was generated by Apache iBATIS ibator.
  12. * This method corresponds to the database table xt_flzbj_gzxx
  13. *
  14. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  15. */
  16. public XtFlzbjgzxxDAOImpl() {
  17. super();
  18. }
  19. /**
  20. * This method was generated by Apache iBATIS ibator.
  21. * This method corresponds to the database table xt_flzbj_gzxx
  22. *
  23. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  24. */
  25. public int countByExample(XtFlzbjgzxxExample example) {
  26. Integer count = (Integer) getSqlMapClientTemplate().queryForObject("xt_flzbj_gzxx.ibatorgenerated_countByExample", example);
  27. return count;
  28. }
  29. /**
  30. * This method was generated by Apache iBATIS ibator.
  31. * This method corresponds to the database table xt_flzbj_gzxx
  32. *
  33. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  34. */
  35. public int deleteByExample(XtFlzbjgzxxExample example) {
  36. int rows = getSqlMapClientTemplate().delete("xt_flzbj_gzxx.ibatorgenerated_deleteByExample", example);
  37. return rows;
  38. }
  39. /**
  40. * This method was generated by Apache iBATIS ibator.
  41. * This method corresponds to the database table xt_flzbj_gzxx
  42. *
  43. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  44. */
  45. public int deleteByPrimaryKey(Integer id) {
  46. XtFlzbjgzxx key = new XtFlzbjgzxx();
  47. key.setId(id);
  48. int rows = getSqlMapClientTemplate().delete("xt_flzbj_gzxx.ibatorgenerated_deleteByPrimaryKey", key);
  49. return rows;
  50. }
  51. /**
  52. * This method was generated by Apache iBATIS ibator.
  53. * This method corresponds to the database table xt_flzbj_gzxx
  54. *
  55. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  56. */
  57. public void insert(XtFlzbjgzxx record) {
  58. getSqlMapClientTemplate().insert("xt_flzbj_gzxx.ibatorgenerated_insert", record);
  59. }
  60. /**
  61. * This method was generated by Apache iBATIS ibator.
  62. * This method corresponds to the database table xt_flzbj_gzxx
  63. *
  64. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  65. */
  66. public void insertSelective(XtFlzbjgzxx record) {
  67. getSqlMapClientTemplate().insert("xt_flzbj_gzxx.ibatorgenerated_insertSelective", record);
  68. }
  69. /**
  70. * This method was generated by Apache iBATIS ibator.
  71. * This method corresponds to the database table xt_flzbj_gzxx
  72. *
  73. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  74. */
  75. @SuppressWarnings("unchecked")
  76. public List<XtFlzbjgzxx> selectByExample(XtFlzbjgzxxExample example) {
  77. List<XtFlzbjgzxx> list = getSqlMapClientTemplate().queryForList("xt_flzbj_gzxx.ibatorgenerated_selectByExample", example);
  78. return list;
  79. }
  80. /**
  81. * This method was generated by Apache iBATIS ibator.
  82. * This method corresponds to the database table xt_flzbj_gzxx
  83. *
  84. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  85. */
  86. public XtFlzbjgzxx selectByPrimaryKey(Integer id) {
  87. XtFlzbjgzxx key = new XtFlzbjgzxx();
  88. key.setId(id);
  89. XtFlzbjgzxx record = (XtFlzbjgzxx) getSqlMapClientTemplate().queryForObject("xt_flzbj_gzxx.ibatorgenerated_selectByPrimaryKey", key);
  90. return record;
  91. }
  92. /**
  93. * This method was generated by Apache iBATIS ibator.
  94. * This method corresponds to the database table xt_flzbj_gzxx
  95. *
  96. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  97. */
  98. public int updateByExampleSelective(XtFlzbjgzxx record, XtFlzbjgzxxExample example) {
  99. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  100. int rows = getSqlMapClientTemplate().update("xt_flzbj_gzxx.ibatorgenerated_updateByExampleSelective", parms);
  101. return rows;
  102. }
  103. /**
  104. * This method was generated by Apache iBATIS ibator.
  105. * This method corresponds to the database table xt_flzbj_gzxx
  106. *
  107. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  108. */
  109. public int updateByExample(XtFlzbjgzxx record, XtFlzbjgzxxExample example) {
  110. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  111. int rows = getSqlMapClientTemplate().update("xt_flzbj_gzxx.ibatorgenerated_updateByExample", parms);
  112. return rows;
  113. }
  114. /**
  115. * This method was generated by Apache iBATIS ibator.
  116. * This method corresponds to the database table xt_flzbj_gzxx
  117. *
  118. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  119. */
  120. public int updateByPrimaryKeySelective(XtFlzbjgzxx record) {
  121. int rows = getSqlMapClientTemplate().update("xt_flzbj_gzxx.ibatorgenerated_updateByPrimaryKeySelective", record);
  122. return rows;
  123. }
  124. /**
  125. * This method was generated by Apache iBATIS ibator.
  126. * This method corresponds to the database table xt_flzbj_gzxx
  127. *
  128. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  129. */
  130. public int updateByPrimaryKey(XtFlzbjgzxx record) {
  131. int rows = getSqlMapClientTemplate().update("xt_flzbj_gzxx.ibatorgenerated_updateByPrimaryKey", record);
  132. return rows;
  133. }
  134. /**
  135. * This class was generated by Apache iBATIS ibator.
  136. * This class corresponds to the database table xt_flzbj_gzxx
  137. *
  138. * @ibatorgenerated Thu Sep 08 15:24:34 CST 2016
  139. */
  140. private static class UpdateByExampleParms extends XtFlzbjgzxxExample {
  141. private Object record;
  142. public UpdateByExampleParms(Object record, XtFlzbjgzxxExample example) {
  143. super(example);
  144. this.record = record;
  145. }
  146. public Object getRecord() {
  147. return record;
  148. }
  149. }
  150. /**
  151. * 插入环控报警故障信息
  152. */
  153. public void insertFlzbjgzxxByParam(List<XtFlzbjgzxx> paramMapList) {
  154. XtFlzbjgzxxSqlMapClientCallback xtFlzbjgzxxSqlMapClientCallback = new XtFlzbjgzxxSqlMapClientCallback();
  155. xtFlzbjgzxxSqlMapClientCallback.setParamMapList(paramMapList);
  156. getSqlMapClientTemplate().execute(xtFlzbjgzxxSqlMapClientCallback);
  157. }
  158. /**
  159. * 插入数据的回调类
  160. */
  161. private class XtFlzbjgzxxSqlMapClientCallback implements SqlMapClientCallback {
  162. private List<XtFlzbjgzxx> paramMapList;
  163. public void setParamMapList(List<XtFlzbjgzxx> paramMapList) {
  164. this.paramMapList = paramMapList;
  165. }
  166. @Override
  167. public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
  168. executor.startBatch();
  169. for (XtFlzbjgzxx xtFlzbjgzxx : paramMapList) {
  170. executor.insert("xt_flzbj_gzxx.ibatorgenerated_insertSelective", xtFlzbjgzxx);
  171. }
  172. executor.executeBatch();
  173. return null;
  174. }
  175. }
  176. }