XtLypzDAOImpl.java 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. package com.huimv.xt.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.xt.dataobject.XtLypz;
  9. import com.huimv.xt.dataobject.XtLypzExample;
  10. import com.ibatis.sqlmap.client.SqlMapExecutor;
  11. public class XtLypzDAOImpl extends SqlMapClientDaoSupport implements XtLypzDAO {
  12. /**
  13. * This method was generated by Apache iBATIS ibator.
  14. * This method corresponds to the database table xt_lypz
  15. *
  16. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  17. */
  18. public XtLypzDAOImpl() {
  19. super();
  20. }
  21. /**
  22. * This method was generated by Apache iBATIS ibator.
  23. * This method corresponds to the database table xt_lypz
  24. *
  25. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  26. */
  27. public int countByExample(XtLypzExample example) {
  28. Integer count = (Integer) getSqlMapClientTemplate().queryForObject("xt_lypz.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 xt_lypz
  34. *
  35. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  36. */
  37. public int deleteByExample(XtLypzExample example) {
  38. int rows = getSqlMapClientTemplate().delete("xt_lypz.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 xt_lypz
  44. *
  45. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  46. */
  47. public int deleteByPrimaryKey(Integer id) {
  48. XtLypz key = new XtLypz();
  49. key.setId(id);
  50. int rows = getSqlMapClientTemplate().delete("xt_lypz.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 xt_lypz
  56. *
  57. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  58. */
  59. public void insert(XtLypz record) {
  60. getSqlMapClientTemplate().insert("xt_lypz.ibatorgenerated_insert", record);
  61. }
  62. /**
  63. * This method was generated by Apache iBATIS ibator.
  64. * This method corresponds to the database table xt_lypz
  65. *
  66. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  67. */
  68. public void insertSelective(XtLypz record) {
  69. getSqlMapClientTemplate().insert("xt_lypz.ibatorgenerated_insertSelective", record);
  70. }
  71. /**
  72. * This method was generated by Apache iBATIS ibator.
  73. * This method corresponds to the database table xt_lypz
  74. *
  75. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  76. */
  77. @SuppressWarnings("unchecked")
  78. public List<XtLypz> selectByExample(XtLypzExample example) {
  79. List<XtLypz> list = getSqlMapClientTemplate().queryForList("xt_lypz.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 xt_lypz
  85. *
  86. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  87. */
  88. public XtLypz selectByPrimaryKey(Integer id) {
  89. XtLypz key = new XtLypz();
  90. key.setId(id);
  91. XtLypz record = (XtLypz) getSqlMapClientTemplate().queryForObject("xt_lypz.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 xt_lypz
  97. *
  98. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  99. */
  100. public int updateByExampleSelective(XtLypz record, XtLypzExample example) {
  101. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  102. int rows = getSqlMapClientTemplate().update("xt_lypz.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 xt_lypz
  108. *
  109. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  110. */
  111. public int updateByExample(XtLypz record, XtLypzExample example) {
  112. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  113. int rows = getSqlMapClientTemplate().update("xt_lypz.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 xt_lypz
  119. *
  120. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  121. */
  122. public int updateByPrimaryKeySelective(XtLypz record) {
  123. int rows = getSqlMapClientTemplate().update("xt_lypz.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 xt_lypz
  129. *
  130. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  131. */
  132. public int updateByPrimaryKey(XtLypz record) {
  133. int rows = getSqlMapClientTemplate().update("xt_lypz.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 xt_lypz
  139. *
  140. * @ibatorgenerated Mon May 30 09:08:48 CST 2016
  141. */
  142. private static class UpdateByExampleParms extends XtLypzExample {
  143. private Object record;
  144. public UpdateByExampleParms(Object record, XtLypzExample example) {
  145. super(example);
  146. this.record = record;
  147. }
  148. public Object getRecord() {
  149. return record;
  150. }
  151. }
  152. /**
  153. * 插入环控报警故障信息
  154. */
  155. public void insertLypzListByParam(List<XtLypz> paramMapList) {
  156. XtLypzSqlMapClientCallback xtLypzSqlMapClientCallback = new XtLypzSqlMapClientCallback();
  157. xtLypzSqlMapClientCallback.setParamMapList(paramMapList);
  158. getSqlMapClientTemplate().execute(xtLypzSqlMapClientCallback);
  159. }
  160. /**
  161. * 插入数据的回调类
  162. */
  163. private class XtLypzSqlMapClientCallback implements SqlMapClientCallback {
  164. private List<XtLypz> paramMapList;
  165. public void setParamMapList(List<XtLypz> paramMapList) {
  166. this.paramMapList = paramMapList;
  167. }
  168. @Override
  169. public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
  170. executor.startBatch();
  171. for (XtLypz xtLypz : paramMapList) {
  172. executor.insert("xt_lypz.ibatorgenerated_insertSelective", xtLypz);
  173. }
  174. executor.executeBatch();
  175. return null;
  176. }
  177. }
  178. public List<XtLypz> selectLypzByParam(Map<String, Object> paramMap) {
  179. @SuppressWarnings("unchecked")
  180. List<XtLypz> lypzList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_LYPZ_BY_PARAM, paramMap);
  181. return lypzList;
  182. }
  183. }