package com.consum.model.po; import com.walker.jdbc.BaseMapper; import com.walker.jdbc.ResultSetUtils; import com.walker.jdbc.SqlAndParameters; import com.walker.jdbc.sqlgen.DeleteBuilder; import com.walker.jdbc.sqlgen.InsertBuilder; import com.walker.jdbc.sqlgen.SelectBuilder; import com.walker.jdbc.sqlgen.UpdateBuilder; import org.springframework.jdbc.core.RowMapper; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Map; /** * 表名:DEP_FORM_SCRAPPED * * @author genrator */ public class DepFormScrapped_mapper extends DepFormScrapped implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new DepFormScrappedRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String BusinessFormCode = "business_form_code"; public static final String ProcureDoc = "procure_doc"; public static final String OutWarehouseType = "out_warehouse_type"; public static final String OutWarehouseId = "out_warehouse_id"; public static final String OutWarehouseName = "out_warehouse_name"; public static final String OperatorId = "operator_id"; public static final String OperatorName = "operator_name"; public static final String DealTime = "deal_time"; public static final String DepartmentId = "department_id"; public static final String DepartmentName = "department_name"; public static final String CreateTime = "create_time"; public static final String States = "states"; public static final String Beiz = "beiz"; /** * 默认构造函数 */ public DepFormScrapped_mapper(DepFormScrapped depFormScrapped) { if (depFormScrapped == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (depFormScrapped.isset_id) { this.setId(depFormScrapped.getId()); } //普通属性 if (depFormScrapped.isset_businessFormCode) { this.setBusinessFormCode(depFormScrapped.getBusinessFormCode()); } if (depFormScrapped.isset_procureDoc) { this.setProcureDoc(depFormScrapped.getProcureDoc()); } if (depFormScrapped.isset_outWarehouseType) { this.setOutWarehouseType(depFormScrapped.getOutWarehouseType()); } if (depFormScrapped.isset_outWarehouseId) { this.setOutWarehouseId(depFormScrapped.getOutWarehouseId()); } if (depFormScrapped.isset_outWarehouseName) { this.setOutWarehouseName(depFormScrapped.getOutWarehouseName()); } if (depFormScrapped.isset_operatorId) { this.setOperatorId(depFormScrapped.getOperatorId()); } if (depFormScrapped.isset_operatorName) { this.setOperatorName(depFormScrapped.getOperatorName()); } if (depFormScrapped.isset_dealTime) { this.setDealTime(depFormScrapped.getDealTime()); } if (depFormScrapped.isset_departmentId) { this.setDepartmentId(depFormScrapped.getDepartmentId()); } if (depFormScrapped.isset_departmentName) { this.setDepartmentName(depFormScrapped.getDepartmentName()); } if (depFormScrapped.isset_createTime) { this.setCreateTime(depFormScrapped.getCreateTime()); } if (depFormScrapped.isset_states) { this.setStates(depFormScrapped.getStates()); } if (depFormScrapped.isset_beiz) { this.setBeiz(depFormScrapped.getBeiz()); } // 去掉,2022-09-07 // this.setDatabaseName_(dep_form_scrapped.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "dep_form_scrapped"; /** if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } else { return tableName; } */ return tableName; } /** * 获取主键名称 */ @Override public String getPkName_() { return Id; } /** * 获取主键值 */ @Override public Object getPkValue_() { return this.getId(); } /** * 获取插入语句和参数 */ @Override public SqlAndParameters> getInsertSql_() { InsertBuilder ib = new InsertBuilder(this.getTableName_()); ib.set(Id, this.getId()); ib.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ib.set(ProcureDoc, this.getProcureDoc(), this.isset_procureDoc); ib.set(OutWarehouseType, this.getOutWarehouseType(), this.isset_outWarehouseType); ib.set(OutWarehouseId, this.getOutWarehouseId(), this.isset_outWarehouseId); ib.set(OutWarehouseName, this.getOutWarehouseName(), this.isset_outWarehouseName); ib.set(OperatorId, this.getOperatorId(), this.isset_operatorId); ib.set(OperatorName, this.getOperatorName(), this.isset_operatorName); ib.set(DealTime, this.getDealTime(), this.isset_dealTime); ib.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ib.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); ib.set(CreateTime, this.getCreateTime(), this.isset_createTime); ib.set(States, this.getStates(), this.isset_states); ib.set(Beiz, this.getBeiz(), this.isset_beiz); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(ProcureDoc, this.getProcureDoc(), this.isset_procureDoc); ub.set(OutWarehouseType, this.getOutWarehouseType(), this.isset_outWarehouseType); ub.set(OutWarehouseId, this.getOutWarehouseId(), this.isset_outWarehouseId); ub.set(OutWarehouseName, this.getOutWarehouseName(), this.isset_outWarehouseName); ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName); ub.set(DealTime, this.getDealTime(), this.isset_dealTime); ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); ub.set(States, this.getStates(), this.isset_states); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.where(this.getPkName_(), this.getPkValue_()); return ub.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_(String where, Map parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(ProcureDoc, this.getProcureDoc(), this.isset_procureDoc); ub.set(OutWarehouseType, this.getOutWarehouseType(), this.isset_outWarehouseType); ub.set(OutWarehouseId, this.getOutWarehouseId(), this.isset_outWarehouseId); ub.set(OutWarehouseName, this.getOutWarehouseName(), this.isset_outWarehouseName); ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName); ub.set(DealTime, this.getDealTime(), this.isset_dealTime); ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); ub.set(States, this.getStates(), this.isset_states); ub.set(Beiz, this.getBeiz(), this.isset_beiz); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(ProcureDoc, this.getProcureDoc(), this.isset_procureDoc); ub.set(OutWarehouseType, this.getOutWarehouseType(), this.isset_outWarehouseType); ub.set(OutWarehouseId, this.getOutWarehouseId(), this.isset_outWarehouseId); ub.set(OutWarehouseName, this.getOutWarehouseName(), this.isset_outWarehouseName); ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName); ub.set(DealTime, this.getDealTime(), this.isset_dealTime); ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); ub.set(States, this.getStates(), this.isset_states); ub.set(Beiz, this.getBeiz(), this.isset_beiz); return ub.genArraySql(where, parameters); } /** * 获取删除语句和参数 */ @Override public SqlAndParameters> getDeleteSql_() { DeleteBuilder db = new DeleteBuilder(this.getTableName_()); db.where(this.getPkName_(), this.getPkValue_()); return db.genMapSql(); } /** * 获取删除语句和参数 */ @Override public SqlAndParameters> getDeleteSql_(String where, Map parameters) { DeleteBuilder db = new DeleteBuilder(this.getTableName_()); return db.genMapSql(where, parameters); } /** * 获取删除语句和参数 */ @Override public SqlAndParameters getDeleteSql_(String where, Object[] parameters) { DeleteBuilder db = new DeleteBuilder(this.getTableName_()); return db.genArraySql(where, parameters); } /** * 获取单行查询语句和参数 */ @Override public SqlAndParameters> getSingleSql_() { SelectBuilder sb = new SelectBuilder(this.getTableName_()); sb.where(this.getPkName_(), this.getPkValue_()); return sb.genMapSql(); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters> getSelectSql_(String where, Map parameters) { return new SqlAndParameters<>("select id, business_form_code, procure_doc, out_warehouse_type, out_warehouse_id, out_warehouse_name, operator_id, operator_name, deal_time, department_id, department_name, create_time, states, beiz from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, business_form_code, procure_doc, out_warehouse_type, out_warehouse_id, out_warehouse_name, operator_id, operator_name, deal_time, department_id, department_name, create_time, states, beiz from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public DepFormScrapped mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public DepFormScrapped toDepFormScrapped() { return super.$clone(); } } /** * dep_form_scrapped RowMapper * * @author genrator */ class DepFormScrappedRowMapper implements RowMapper { @Override public DepFormScrapped mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); DepFormScrapped dep_form_scrapped = new DepFormScrapped(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.Id); if (columnIndex > 0) { dep_form_scrapped.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.BusinessFormCode); if (columnIndex > 0) { dep_form_scrapped.setBusinessFormCode(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.ProcureDoc); if (columnIndex > 0) { dep_form_scrapped.setProcureDoc(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.OutWarehouseType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped.setOutWarehouseType(null); } else { dep_form_scrapped.setOutWarehouseType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.OutWarehouseId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped.setOutWarehouseId(null); } else { dep_form_scrapped.setOutWarehouseId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.OutWarehouseName); if (columnIndex > 0) { dep_form_scrapped.setOutWarehouseName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.OperatorId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped.setOperatorId(null); } else { dep_form_scrapped.setOperatorId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.OperatorName); if (columnIndex > 0) { dep_form_scrapped.setOperatorName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.DealTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped.setDealTime(null); } else { dep_form_scrapped.setDealTime(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.DepartmentId); if (columnIndex > 0) { dep_form_scrapped.setDepartmentId(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.DepartmentName); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped.setDepartmentName(null); } else { dep_form_scrapped.setDepartmentName(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.CreateTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped.setCreateTime(null); } else { dep_form_scrapped.setCreateTime(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.States); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped.setStates(null); } else { dep_form_scrapped.setStates(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrapped_mapper.Beiz); if (columnIndex > 0) { dep_form_scrapped.setBeiz(rs.getString(columnIndex)); } return dep_form_scrapped; } }