123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- 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<XtYxcsYa> selectByExample(XtYxcsYaExample example) {
- List<XtYxcsYa> 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<XtYxcsYa> yxcsYaList) {
- HpHkyxcsClientCallback hpHkyxcsClientCallback = new HpHkyxcsClientCallback();
- hpHkyxcsClientCallback.setYxcsYaList(yxcsYaList);
- getSqlMapClientTemplate().execute(hpHkyxcsClientCallback);
- }
- //回调
- public class HpHkyxcsClientCallback implements SqlMapClientCallback{
- private List<XtYxcsYa> yxcsYaList;
- public void setYxcsYaList(List<XtYxcsYa> 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;
- }
- }
- }
|