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 selectByExample(XtLypzExample example) { List 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 paramMapList) { XtLypzSqlMapClientCallback xtLypzSqlMapClientCallback = new XtLypzSqlMapClientCallback(); xtLypzSqlMapClientCallback.setParamMapList(paramMapList); getSqlMapClientTemplate().execute(xtLypzSqlMapClientCallback); } /** * 插入数据的回调类 */ private class XtLypzSqlMapClientCallback implements SqlMapClientCallback { private List paramMapList; public void setParamMapList(List 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 selectLypzByParam(Map paramMap) { @SuppressWarnings("unchecked") List lypzList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_LYPZ_BY_PARAM, paramMap); return lypzList; } }