package com.huimv.xt.dao; import com.huimv.xt.dataobject.XtYxcsYa; import com.huimv.xt.dataobject.XtYxcsYaExample; import com.ibatis.sqlmap.client.SqlMapExecutor; import java.sql.SQLException; import java.util.List; import org.springframework.orm.ibatis.SqlMapClientCallback; import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport; public class XtYxcsYaDAOImpl extends SqlMapClientDaoSupport implements XtYxcsYaDAO { /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public XtYxcsYaDAOImpl() { super(); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public int countByExample(XtYxcsYaExample example) { Integer count = (Integer) getSqlMapClientTemplate().queryForObject("xt_hk_yxcs_bys_ya.ibatorgenerated_countByExample", example); return count; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public int deleteByExample(XtYxcsYaExample example) { int rows = getSqlMapClientTemplate().delete("xt_hk_yxcs_bys_ya.ibatorgenerated_deleteByExample", example); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public int deleteByPrimaryKey(Integer id) { XtYxcsYa key = new XtYxcsYa(); key.setId(id); int rows = getSqlMapClientTemplate().delete("xt_hk_yxcs_bys_ya.ibatorgenerated_deleteByPrimaryKey", key); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public void insert(XtYxcsYa record) { getSqlMapClientTemplate().insert("xt_hk_yxcs_bys_ya.ibatorgenerated_insert", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public void insertSelective(XtYxcsYa record) { getSqlMapClientTemplate().insert("xt_hk_yxcs_bys_ya.ibatorgenerated_insertSelective", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ @SuppressWarnings("unchecked") public List selectByExample(XtYxcsYaExample example) { List list = getSqlMapClientTemplate().queryForList("xt_hk_yxcs_bys_ya.ibatorgenerated_selectByExample", example); return list; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public XtYxcsYa selectByPrimaryKey(Integer id) { XtYxcsYa key = new XtYxcsYa(); key.setId(id); XtYxcsYa record = (XtYxcsYa) getSqlMapClientTemplate().queryForObject("xt_hk_yxcs_bys_ya.ibatorgenerated_selectByPrimaryKey", key); return record; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public int updateByExampleSelective(XtYxcsYa record, XtYxcsYaExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("xt_hk_yxcs_bys_ya.ibatorgenerated_updateByExampleSelective", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public int updateByExample(XtYxcsYa record, XtYxcsYaExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("xt_hk_yxcs_bys_ya.ibatorgenerated_updateByExample", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public int updateByPrimaryKeySelective(XtYxcsYa record) { int rows = getSqlMapClientTemplate().update("xt_hk_yxcs_bys_ya.ibatorgenerated_updateByPrimaryKeySelective", record); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ public int updateByPrimaryKey(XtYxcsYa record) { int rows = getSqlMapClientTemplate().update("xt_hk_yxcs_bys_ya.ibatorgenerated_updateByPrimaryKey", record); return rows; } /** * This class was generated by Apache iBATIS ibator. * This class corresponds to the database table xt_hk_yxcs_bys_ya * * @ibatorgenerated Fri Sep 08 13:22:44 CST 2017 */ private static class UpdateByExampleParms extends XtYxcsYaExample { private Object record; public UpdateByExampleParms(Object record, XtYxcsYaExample example) { super(example); this.record = record; } public Object getRecord() { return record; } } /** * 批量作废 */ public void batchUpdateHkyxcsyaByList(List yxcsYaList) { HpHkyxcsClientCallback hpHkyxcsClientCallback = new HpHkyxcsClientCallback(); hpHkyxcsClientCallback.setYxcsYaList(yxcsYaList); getSqlMapClientTemplate().execute(hpHkyxcsClientCallback); } //回调 public class HpHkyxcsClientCallback implements SqlMapClientCallback{ private List yxcsYaList; public void setYxcsYaList(List yxcsYaList) { this.yxcsYaList = yxcsYaList; } public Object doInSqlMapClient(SqlMapExecutor executor)throws SQLException { executor.startBatch(); XtYxcsYa yxcs = null; for(int i = 0 ; i < yxcsYaList.size(); i++) { yxcs = yxcsYaList.get(i); executor.update("xt_hk_yxcs_bys_ya.ibatorgenerated_updateByPrimaryKeySelective",yxcs); } executor.executeBatch(); return null; } } }