SjJllcsjDAOImpl.java 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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.SjJllcsj;
  10. import com.huimv.sj.dataobject.SjJllcsjExample;
  11. import com.ibatis.sqlmap.client.SqlMapExecutor;
  12. public class SjJllcsjDAOImpl extends SqlMapClientDaoSupport implements SjJllcsjDAO {
  13. /**
  14. * This method was generated by Apache iBATIS ibator.
  15. * This method corresponds to the database table sj_jllcsj
  16. *
  17. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  18. */
  19. public SjJllcsjDAOImpl() {
  20. super();
  21. }
  22. /**
  23. * This method was generated by Apache iBATIS ibator.
  24. * This method corresponds to the database table sj_jllcsj
  25. *
  26. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  27. */
  28. public int countByExample(SjJllcsjExample example) {
  29. Integer count = (Integer) getSqlMapClientTemplate().queryForObject("sj_jllcsj.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_jllcsj
  35. *
  36. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  37. */
  38. public int deleteByExample(SjJllcsjExample example) {
  39. int rows = getSqlMapClientTemplate().delete("sj_jllcsj.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_jllcsj
  45. *
  46. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  47. */
  48. public int deleteByPrimaryKey(Integer id) {
  49. SjJllcsj key = new SjJllcsj();
  50. key.setId(id);
  51. int rows = getSqlMapClientTemplate().delete("sj_jllcsj.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_jllcsj
  57. *
  58. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  59. */
  60. public void insert(SjJllcsj record) {
  61. getSqlMapClientTemplate().insert("sj_jllcsj.ibatorgenerated_insert", record);
  62. }
  63. /**
  64. * This method was generated by Apache iBATIS ibator.
  65. * This method corresponds to the database table sj_jllcsj
  66. *
  67. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  68. */
  69. public void insertSelective(SjJllcsj record) {
  70. getSqlMapClientTemplate().insert("sj_jllcsj.ibatorgenerated_insertSelective", record);
  71. }
  72. /**
  73. * This method was generated by Apache iBATIS ibator.
  74. * This method corresponds to the database table sj_jllcsj
  75. *
  76. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  77. */
  78. @SuppressWarnings("unchecked")
  79. public List<SjJllcsj> selectByExample(SjJllcsjExample example) {
  80. List<SjJllcsj> list = getSqlMapClientTemplate().queryForList("sj_jllcsj.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_jllcsj
  86. *
  87. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  88. */
  89. public SjJllcsj selectByPrimaryKey(Integer id) {
  90. SjJllcsj key = new SjJllcsj();
  91. key.setId(id);
  92. SjJllcsj record = (SjJllcsj) getSqlMapClientTemplate().queryForObject("sj_jllcsj.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_jllcsj
  98. *
  99. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  100. */
  101. public int updateByExampleSelective(SjJllcsj record, SjJllcsjExample example) {
  102. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  103. int rows = getSqlMapClientTemplate().update("sj_jllcsj.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_jllcsj
  109. *
  110. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  111. */
  112. public int updateByExample(SjJllcsj record, SjJllcsjExample example) {
  113. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  114. int rows = getSqlMapClientTemplate().update("sj_jllcsj.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_jllcsj
  120. *
  121. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  122. */
  123. public int updateByPrimaryKeySelective(SjJllcsj record) {
  124. int rows = getSqlMapClientTemplate().update("sj_jllcsj.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_jllcsj
  130. *
  131. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  132. */
  133. public int updateByPrimaryKey(SjJllcsj record) {
  134. int rows = getSqlMapClientTemplate().update("sj_jllcsj.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_jllcsj
  140. *
  141. * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016
  142. */
  143. private static class UpdateByExampleParms extends SjJllcsjExample {
  144. private Object record;
  145. public UpdateByExampleParms(Object record, SjJllcsjExample example) {
  146. super(example);
  147. this.record = record;
  148. }
  149. public Object getRecord() {
  150. return record;
  151. }
  152. }
  153. /**
  154. * 得到指定条件的环境控制记录的最大时间
  155. */
  156. public Date selectMaxJllcsjTimeByParam(Map<String, Object> searchParam) {
  157. Date date = (Date) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_SELECT_MAX_JLLCSJ_BY_PARAM, searchParam);
  158. return date;
  159. }
  160. /**
  161. * 插入计量料槽
  162. */
  163. public void insertJllcsjByParam(List<SjJllcsj> paramMapList) {
  164. SjJllcsjSqlMapClientCallback sjJllcsjSqlMapClientCallback = new SjJllcsjSqlMapClientCallback();
  165. sjJllcsjSqlMapClientCallback.setParamMapList(paramMapList);
  166. getSqlMapClientTemplate().execute(sjJllcsjSqlMapClientCallback);
  167. }
  168. /**
  169. * 插入数据的回调类
  170. */
  171. private class SjJllcsjSqlMapClientCallback implements SqlMapClientCallback {
  172. private List<SjJllcsj> paramMapList;
  173. public void setParamMapList(List<SjJllcsj> paramMapList) {
  174. this.paramMapList = paramMapList;
  175. }
  176. @Override
  177. public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
  178. executor.startBatch();
  179. for (SjJllcsj sjJllcsj : paramMapList) {
  180. executor.insert("sj_jllcsj.ibatorgenerated_insertSelective", sjJllcsj);
  181. }
  182. executor.executeBatch();
  183. return null;
  184. }
  185. }
  186. @SuppressWarnings("unchecked")
  187. public List<SjJllcsj> selectJllcsjCslByParam(Map<String, Object> paramMap) {
  188. List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_CSL_BY_PARAM, paramMap);
  189. return list;
  190. }
  191. @SuppressWarnings("unchecked")
  192. public List<SjJllcsj> selectJllcsjLcidByParam(Map<String, Object> paramMap) {
  193. List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_LCID_BY_PARAM, paramMap);
  194. return list;
  195. }
  196. @SuppressWarnings("unchecked")
  197. public List<SjJllcsj> selectJllcsjLccslByParam(Map<String, Object> paramMap) {
  198. List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_LCCSL_BY_PARAM, paramMap);
  199. return list;
  200. }
  201. @SuppressWarnings("unchecked")
  202. public List<SjJllcsj> selectJllcsjLcidCslByParam(Map<String, Object> paramMap) {
  203. List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_LCID_CSL_BY_PARAM, paramMap);
  204. return list;
  205. }
  206. @SuppressWarnings("unchecked")
  207. public List<SjJllcsj> selectJllcsjHyzsByParam(Map<String, Object> paramMap) {
  208. List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_HYZS_BY_PARAM, paramMap);
  209. return list;
  210. }
  211. public String selectJllcsjSumcslByParam(Map<String, Object> paramMap) {
  212. String csl = (String)getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_SUM_CSL_BY_PARAM, paramMap);
  213. return csl;
  214. }
  215. }