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 com.walker.jdbc.util.StringUtils; import org.springframework.jdbc.core.RowMapper; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Map; /** * 表名:USING_GOODS_HIS * * @author genrator */ public class UsingGoodsHis_mapper extends UsingGoodsHis implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new UsingGoodsHisRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String BusinessFormId = "business_form_id"; public static final String BusinessFormCode = "business_form_code"; public static final String BusinessFormName = "business_form_name"; public static final String Beiz = "beiz"; public static final String Classification = "classification"; 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 DepFormLendingModelId = "dep_form_lending_model_id"; public static final String DepFormLendingGoodsId = "dep_form_lending_goods_id"; public static final String DepFormLendingId = "dep_form_lending_id"; public static final String WhGoodsId = "wh_goods_id"; public static final String InitialCount = "initial_count"; public static final String ThisCount = "this_count"; public static final String EndCount = "end_count"; public static final String ScrappedCode = "scrapped_code"; public static final String ScrappedName = "scrapped_name"; public static final String WarehouseId = "warehouse_id"; public static final String WarehouseName = "warehouse_name"; public static final String DepartmentId = "department_id"; public static final String DepartmentName = "department_name"; /** * 默认构造函数 */ public UsingGoodsHis_mapper(UsingGoodsHis usingGoodsHis) { if (usingGoodsHis == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (usingGoodsHis.isset_id) { this.setId(usingGoodsHis.getId()); } //普通属性 if (usingGoodsHis.isset_businessFormId) { this.setBusinessFormId(usingGoodsHis.getBusinessFormId()); } if (usingGoodsHis.isset_businessFormCode) { this.setBusinessFormCode(usingGoodsHis.getBusinessFormCode()); } if (usingGoodsHis.isset_businessFormName) { this.setBusinessFormName(usingGoodsHis.getBusinessFormName()); } if (usingGoodsHis.isset_beiz) { this.setBeiz(usingGoodsHis.getBeiz()); } if (usingGoodsHis.isset_classification) { this.setClassification(usingGoodsHis.getClassification()); } if (usingGoodsHis.isset_operatorId) { this.setOperatorId(usingGoodsHis.getOperatorId()); } if (usingGoodsHis.isset_operatorName) { this.setOperatorName(usingGoodsHis.getOperatorName()); } if (usingGoodsHis.isset_dealTime) { this.setDealTime(usingGoodsHis.getDealTime()); } if (usingGoodsHis.isset_depFormLendingModelId) { this.setDepFormLendingModelId(usingGoodsHis.getDepFormLendingModelId()); } if (usingGoodsHis.isset_depFormLendingGoodsId) { this.setDepFormLendingGoodsId(usingGoodsHis.getDepFormLendingGoodsId()); } if (usingGoodsHis.isset_depFormLendingId) { this.setDepFormLendingId(usingGoodsHis.getDepFormLendingId()); } if (usingGoodsHis.isset_whGoodsId) { this.setWhGoodsId(usingGoodsHis.getWhGoodsId()); } if (usingGoodsHis.isset_initialCount) { this.setInitialCount(usingGoodsHis.getInitialCount()); } if (usingGoodsHis.isset_thisCount) { this.setThisCount(usingGoodsHis.getThisCount()); } if (usingGoodsHis.isset_endCount) { this.setEndCount(usingGoodsHis.getEndCount()); } if (usingGoodsHis.isset_scrappedCode) { this.setScrappedCode(usingGoodsHis.getScrappedCode()); } if (usingGoodsHis.isset_scrappedName) { this.setScrappedName(usingGoodsHis.getScrappedName()); } if (usingGoodsHis.isset_warehouseId) { this.setWarehouseId(usingGoodsHis.getWarehouseId()); } if (usingGoodsHis.isset_warehouseName) { this.setWarehouseName(usingGoodsHis.getWarehouseName()); } if (usingGoodsHis.isset_departmentId) { this.setDepartmentId(usingGoodsHis.getDepartmentId()); } if (usingGoodsHis.isset_departmentName) { this.setDepartmentName(usingGoodsHis.getDepartmentName()); } // 去掉,2022-09-07 // this.setDatabaseName_(using_goods_his.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "using_goods_his"; /** 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(BusinessFormId, this.getBusinessFormId(), this.isset_businessFormId); ib.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ib.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName); ib.set(Beiz, this.getBeiz(), this.isset_beiz); ib.set(Classification, this.getClassification(), this.isset_classification); 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(DepFormLendingModelId, this.getDepFormLendingModelId(), this.isset_depFormLendingModelId); ib.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId); ib.set(DepFormLendingId, this.getDepFormLendingId(), this.isset_depFormLendingId); ib.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); ib.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ib.set(ThisCount, this.getThisCount(), this.isset_thisCount); ib.set(EndCount, this.getEndCount(), this.isset_endCount); ib.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ib.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ib.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); ib.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ib.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(BusinessFormId, this.getBusinessFormId(), this.isset_businessFormId); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(Classification, this.getClassification(), this.isset_classification); 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(DepFormLendingModelId, this.getDepFormLendingModelId(), this.isset_depFormLendingModelId); ub.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId); ub.set(DepFormLendingId, this.getDepFormLendingId(), this.isset_depFormLendingId); ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ub.set(ThisCount, this.getThisCount(), this.isset_thisCount); ub.set(EndCount, this.getEndCount(), this.isset_endCount); ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); 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(BusinessFormId, this.getBusinessFormId(), this.isset_businessFormId); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(Classification, this.getClassification(), this.isset_classification); 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(DepFormLendingModelId, this.getDepFormLendingModelId(), this.isset_depFormLendingModelId); ub.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId); ub.set(DepFormLendingId, this.getDepFormLendingId(), this.isset_depFormLendingId); ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ub.set(ThisCount, this.getThisCount(), this.isset_thisCount); ub.set(EndCount, this.getEndCount(), this.isset_endCount); ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(BusinessFormId, this.getBusinessFormId(), this.isset_businessFormId); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(Classification, this.getClassification(), this.isset_classification); 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(DepFormLendingModelId, this.getDepFormLendingModelId(), this.isset_depFormLendingModelId); ub.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId); ub.set(DepFormLendingId, this.getDepFormLendingId(), this.isset_depFormLendingId); ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ub.set(ThisCount, this.getThisCount(), this.isset_thisCount); ub.set(EndCount, this.getEndCount(), this.isset_endCount); ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); 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_id, business_form_code, business_form_name, beiz, classification, operator_id, operator_name, deal_time, dep_form_lending_model_id, dep_form_lending_goods_id, dep_form_lending_id, wh_goods_id, initial_count, this_count, end_count, scrapped_code, scrapped_name, warehouse_id, warehouse_name, department_id, department_name from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, business_form_id, business_form_code, business_form_name, beiz, classification, operator_id, operator_name, deal_time, dep_form_lending_model_id, dep_form_lending_goods_id, dep_form_lending_id, wh_goods_id, initial_count, this_count, end_count, scrapped_code, scrapped_name, warehouse_id, warehouse_name, department_id, department_name from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public UsingGoodsHis mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public UsingGoodsHis toUsingGoodsHis() { return super.$clone(); } } /** * using_goods_his RowMapper * * @author genrator */ class UsingGoodsHisRowMapper implements RowMapper { @Override public UsingGoodsHis mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); UsingGoodsHis using_goods_his = new UsingGoodsHis(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.Id); if (columnIndex > 0) { using_goods_his.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.BusinessFormId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setBusinessFormId(null); } else { using_goods_his.setBusinessFormId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.BusinessFormCode); if (columnIndex > 0) { using_goods_his.setBusinessFormCode(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.BusinessFormName); if (columnIndex > 0) { using_goods_his.setBusinessFormName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.Beiz); if (columnIndex > 0) { using_goods_his.setBeiz(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.Classification); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setClassification(null); } else { using_goods_his.setClassification(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.OperatorId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setOperatorId(null); } else { using_goods_his.setOperatorId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.OperatorName); if (columnIndex > 0) { using_goods_his.setOperatorName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.DealTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setDealTime(null); } else { using_goods_his.setDealTime(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.DepFormLendingModelId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setDepFormLendingModelId(null); } else { using_goods_his.setDepFormLendingModelId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.DepFormLendingGoodsId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setDepFormLendingGoodsId(null); } else { using_goods_his.setDepFormLendingGoodsId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.DepFormLendingId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setDepFormLendingId(null); } else { using_goods_his.setDepFormLendingId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.WhGoodsId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setWhGoodsId(null); } else { using_goods_his.setWhGoodsId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.InitialCount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setInitialCount(null); } else { using_goods_his.setInitialCount(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.ThisCount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setThisCount(null); } else { using_goods_his.setThisCount(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.EndCount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setEndCount(null); } else { using_goods_his.setEndCount(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.ScrappedCode); if (columnIndex > 0) { using_goods_his.setScrappedCode(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.ScrappedName); if (columnIndex > 0) { using_goods_his.setScrappedName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.WarehouseId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setWarehouseId(null); } else { using_goods_his.setWarehouseId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.WarehouseName); if (columnIndex > 0) { using_goods_his.setWarehouseName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.DepartmentId); if (columnIndex > 0) { using_goods_his.setDepartmentId(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, UsingGoodsHis_mapper.DepartmentName); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { using_goods_his.setDepartmentName(null); } else { using_goods_his.setDepartmentName(rs.getLong(columnIndex)); } } return using_goods_his; } }