123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- package com.huimv.xt.dao;
- import java.sql.SQLException;
- import java.util.List;
- import java.util.Map;
- import org.springframework.orm.ibatis.SqlMapClientCallback;
- import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
- import com.huimv.busi.xt.constant.XtSqlMapConstant;
- import com.huimv.xt.dataobject.XtLypz;
- import com.huimv.xt.dataobject.XtLypzExample;
- import com.ibatis.sqlmap.client.SqlMapExecutor;
- public class XtLypzDAOImpl extends SqlMapClientDaoSupport implements XtLypzDAO {
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public XtLypzDAOImpl() {
- super();
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public int countByExample(XtLypzExample example) {
- Integer count = (Integer) getSqlMapClientTemplate().queryForObject("xt_lypz.ibatorgenerated_countByExample", example);
- return count;
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public int deleteByExample(XtLypzExample example) {
- int rows = getSqlMapClientTemplate().delete("xt_lypz.ibatorgenerated_deleteByExample", example);
- return rows;
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public int deleteByPrimaryKey(Integer id) {
- XtLypz key = new XtLypz();
- key.setId(id);
- int rows = getSqlMapClientTemplate().delete("xt_lypz.ibatorgenerated_deleteByPrimaryKey", key);
- return rows;
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public void insert(XtLypz record) {
- getSqlMapClientTemplate().insert("xt_lypz.ibatorgenerated_insert", record);
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public void insertSelective(XtLypz record) {
- getSqlMapClientTemplate().insert("xt_lypz.ibatorgenerated_insertSelective", record);
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- @SuppressWarnings("unchecked")
- public List<XtLypz> selectByExample(XtLypzExample example) {
- List<XtLypz> list = getSqlMapClientTemplate().queryForList("xt_lypz.ibatorgenerated_selectByExample", example);
- return list;
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public XtLypz selectByPrimaryKey(Integer id) {
- XtLypz key = new XtLypz();
- key.setId(id);
- XtLypz record = (XtLypz) getSqlMapClientTemplate().queryForObject("xt_lypz.ibatorgenerated_selectByPrimaryKey", key);
- return record;
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public int updateByExampleSelective(XtLypz record, XtLypzExample example) {
- UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
- int rows = getSqlMapClientTemplate().update("xt_lypz.ibatorgenerated_updateByExampleSelective", parms);
- return rows;
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public int updateByExample(XtLypz record, XtLypzExample example) {
- UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
- int rows = getSqlMapClientTemplate().update("xt_lypz.ibatorgenerated_updateByExample", parms);
- return rows;
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public int updateByPrimaryKeySelective(XtLypz record) {
- int rows = getSqlMapClientTemplate().update("xt_lypz.ibatorgenerated_updateByPrimaryKeySelective", record);
- return rows;
- }
- /**
- * This method was generated by Apache iBATIS ibator.
- * This method corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- public int updateByPrimaryKey(XtLypz record) {
- int rows = getSqlMapClientTemplate().update("xt_lypz.ibatorgenerated_updateByPrimaryKey", record);
- return rows;
- }
- /**
- * This class was generated by Apache iBATIS ibator.
- * This class corresponds to the database table xt_lypz
- *
- * @ibatorgenerated Mon May 30 09:08:48 CST 2016
- */
- private static class UpdateByExampleParms extends XtLypzExample {
- private Object record;
- public UpdateByExampleParms(Object record, XtLypzExample example) {
- super(example);
- this.record = record;
- }
- public Object getRecord() {
- return record;
- }
- }
-
- /**
- * 插入环控报警故障信息
- */
- public void insertLypzListByParam(List<XtLypz> paramMapList) {
- XtLypzSqlMapClientCallback xtLypzSqlMapClientCallback = new XtLypzSqlMapClientCallback();
- xtLypzSqlMapClientCallback.setParamMapList(paramMapList);
- getSqlMapClientTemplate().execute(xtLypzSqlMapClientCallback);
- }
-
- /**
- * 插入数据的回调类
- */
- private class XtLypzSqlMapClientCallback implements SqlMapClientCallback {
- private List<XtLypz> paramMapList;
-
- public void setParamMapList(List<XtLypz> paramMapList) {
- this.paramMapList = paramMapList;
- }
- @Override
- public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
- executor.startBatch();
- for (XtLypz xtLypz : paramMapList) {
- executor.insert("xt_lypz.ibatorgenerated_insertSelective", xtLypz);
- }
- executor.executeBatch();
- return null;
- }
- }
-
- public List<XtLypz> selectLypzByParam(Map<String, Object> paramMap) {
- @SuppressWarnings("unchecked")
- List<XtLypz> lypzList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_LYPZ_BY_PARAM, paramMap);
- return lypzList;
- }
- }
|