package com.consum.model.po; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Map; import org.springframework.jdbc.core.RowMapper; 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; /** * 表名:DEP_FORM_SCRAPPED_MODEL * * @author genrator */ public class DepFormScrappedModel_mapper extends DepFormScrappedModel implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new DepFormScrappedModelRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String DepFormScrappedId = "dep_form_scrapped_id"; public static final String DepFormScrappedGoodsId = "dep_form_scrapped_goods_id"; public static final String ScrappedCode = "scrapped_code"; public static final String ScrappedName = "scrapped_name"; public static final String BaseGoodsTemplateId = "base_goods_template_id"; public static final String BaseGoodsTemplateName = "base_goods_template_name"; public static final String Classification = "classification"; public static final String Unit = "unit"; public static final String BaseGoodsModelsId = "base_goods_models_id"; public static final String BaseGoodsModelsName = "base_goods_models_name"; public static final String ProcureModelUserId = "procure_model_user_id"; public static final String InitialCount = "initial_count"; public static final String UseCount = "use_count"; public static final String Counts = "counts"; public static final String GoodsUserName = "goods_user_name"; public static final String Beiz = "beiz"; public static final String TotalAmount = "total_amount"; /** * 默认构造函数 */ public DepFormScrappedModel_mapper(DepFormScrappedModel depFormScrappedModel) { if (depFormScrappedModel == null) { throw new IllegalArgumentException("po参数不允许为空!"); } // 主键 if (depFormScrappedModel.isset_id) { this.setId(depFormScrappedModel.getId()); } // 普通属性 if (depFormScrappedModel.isset_depFormScrappedId) { this.setDepFormScrappedId(depFormScrappedModel.getDepFormScrappedId()); } if (depFormScrappedModel.isset_depFormScrappedGoodsId) { this.setDepFormScrappedGoodsId(depFormScrappedModel.getDepFormScrappedGoodsId()); } if (depFormScrappedModel.isset_scrappedCode) { this.setScrappedCode(depFormScrappedModel.getScrappedCode()); } if (depFormScrappedModel.isset_scrappedName) { this.setScrappedName(depFormScrappedModel.getScrappedName()); } if (depFormScrappedModel.isset_baseGoodsTemplateId) { this.setBaseGoodsTemplateId(depFormScrappedModel.getBaseGoodsTemplateId()); } if (depFormScrappedModel.isset_baseGoodsTemplateName) { this.setBaseGoodsTemplateName(depFormScrappedModel.getBaseGoodsTemplateName()); } if (depFormScrappedModel.isset_classification) { this.setClassification(depFormScrappedModel.getClassification()); } if (depFormScrappedModel.isset_unit) { this.setUnit(depFormScrappedModel.getUnit()); } if (depFormScrappedModel.isset_baseGoodsModelsId) { this.setBaseGoodsModelsId(depFormScrappedModel.getBaseGoodsModelsId()); } if (depFormScrappedModel.isset_baseGoodsModelsName) { this.setBaseGoodsModelsName(depFormScrappedModel.getBaseGoodsModelsName()); } if (depFormScrappedModel.isset_procureModelUserId) { this.setProcureModelUserId(depFormScrappedModel.getProcureModelUserId()); } if (depFormScrappedModel.isset_initialCount) { this.setInitialCount(depFormScrappedModel.getInitialCount()); } if (depFormScrappedModel.isset_useCount) { this.setUseCount(depFormScrappedModel.getUseCount()); } if (depFormScrappedModel.isset_counts) { this.setCounts(depFormScrappedModel.getCounts()); } if (depFormScrappedModel.isset_goodsUserName) { this.setGoodsUserName(depFormScrappedModel.getGoodsUserName()); } if (depFormScrappedModel.isset_beiz) { this.setBeiz(depFormScrappedModel.getBeiz()); } if (depFormScrappedModel.isset_totalAmount) { this.setTotalAmount(depFormScrappedModel.getTotalAmount()); } // 去掉,2022-09-07 // this.setDatabaseName_(dep_form_scrapped_model.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "dep_form_scrapped_model"; /** * 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(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId); ib.set(DepFormScrappedGoodsId, this.getDepFormScrappedGoodsId(), this.isset_depFormScrappedGoodsId); ib.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ib.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ib.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ib.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName); ib.set(Classification, this.getClassification(), this.isset_classification); ib.set(Unit, this.getUnit(), this.isset_unit); ib.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ib.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ib.set(ProcureModelUserId, this.getProcureModelUserId(), this.isset_procureModelUserId); ib.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ib.set(UseCount, this.getUseCount(), this.isset_useCount); ib.set(Counts, this.getCounts(), this.isset_counts); ib.set(GoodsUserName, this.getGoodsUserName(), this.isset_goodsUserName); ib.set(Beiz, this.getBeiz(), this.isset_beiz); ib.set(TotalAmount, this.getTotalAmount(), this.isset_totalAmount); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId); ub.set(DepFormScrappedGoodsId, this.getDepFormScrappedGoodsId(), this.isset_depFormScrappedGoodsId); ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName); ub.set(Classification, this.getClassification(), this.isset_classification); ub.set(Unit, this.getUnit(), this.isset_unit); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(ProcureModelUserId, this.getProcureModelUserId(), this.isset_procureModelUserId); ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ub.set(UseCount, this.getUseCount(), this.isset_useCount); ub.set(Counts, this.getCounts(), this.isset_counts); ub.set(GoodsUserName, this.getGoodsUserName(), this.isset_goodsUserName); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(TotalAmount, this.getTotalAmount(), this.isset_totalAmount); 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(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId); ub.set(DepFormScrappedGoodsId, this.getDepFormScrappedGoodsId(), this.isset_depFormScrappedGoodsId); ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName); ub.set(Classification, this.getClassification(), this.isset_classification); ub.set(Unit, this.getUnit(), this.isset_unit); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(ProcureModelUserId, this.getProcureModelUserId(), this.isset_procureModelUserId); ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ub.set(UseCount, this.getUseCount(), this.isset_useCount); ub.set(Counts, this.getCounts(), this.isset_counts); ub.set(GoodsUserName, this.getGoodsUserName(), this.isset_goodsUserName); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(TotalAmount, this.getTotalAmount(), this.isset_totalAmount); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId); ub.set(DepFormScrappedGoodsId, this.getDepFormScrappedGoodsId(), this.isset_depFormScrappedGoodsId); ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName); ub.set(Classification, this.getClassification(), this.isset_classification); ub.set(Unit, this.getUnit(), this.isset_unit); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(ProcureModelUserId, this.getProcureModelUserId(), this.isset_procureModelUserId); ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ub.set(UseCount, this.getUseCount(), this.isset_useCount); ub.set(Counts, this.getCounts(), this.isset_counts); ub.set(GoodsUserName, this.getGoodsUserName(), this.isset_goodsUserName); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(TotalAmount, this.getTotalAmount(), this.isset_totalAmount); 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, dep_form_scrapped_id, dep_form_scrapped_goods_id, scrapped_code, scrapped_name, base_goods_template_id, base_goods_template_name, classification, unit, base_goods_models_id, base_goods_models_name, procure_model_user_id, initial_count, use_count, counts, goods_user_name, beiz, total_amount from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>( "select id, dep_form_scrapped_id, dep_form_scrapped_goods_id, scrapped_code, scrapped_name, base_goods_template_id, base_goods_template_name, classification, unit, base_goods_models_id, base_goods_models_name, procure_model_user_id, initial_count, use_count, counts, goods_user_name, beiz, total_amount from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public DepFormScrappedModel mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public DepFormScrappedModel toDepFormScrappedModel() { return super.$clone(); } } /** * dep_form_scrapped_model RowMapper * * @author genrator */ class DepFormScrappedModelRowMapper implements RowMapper { @Override public DepFormScrappedModel mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); DepFormScrappedModel dep_form_scrapped_model = new DepFormScrappedModel(); Integer columnIndex; // 主键 columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Id); if (columnIndex > 0) { dep_form_scrapped_model.setId(rs.getLong(columnIndex)); } // 普通属性 columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.DepFormScrappedId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setDepFormScrappedId(null); } else { dep_form_scrapped_model.setDepFormScrappedId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.DepFormScrappedGoodsId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setDepFormScrappedGoodsId(null); } else { dep_form_scrapped_model.setDepFormScrappedGoodsId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.ScrappedCode); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setScrappedCode(null); } else { dep_form_scrapped_model.setScrappedCode(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.ScrappedName); if (columnIndex > 0) { dep_form_scrapped_model.setScrappedName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.BaseGoodsTemplateId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setBaseGoodsTemplateId(null); } else { dep_form_scrapped_model.setBaseGoodsTemplateId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.BaseGoodsTemplateName); if (columnIndex > 0) { dep_form_scrapped_model.setBaseGoodsTemplateName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Classification); if (columnIndex > 0) { dep_form_scrapped_model.setClassification(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Unit); if (columnIndex > 0) { dep_form_scrapped_model.setUnit(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.BaseGoodsModelsId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setBaseGoodsModelsId(null); } else { dep_form_scrapped_model.setBaseGoodsModelsId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.BaseGoodsModelsName); if (columnIndex > 0) { dep_form_scrapped_model.setBaseGoodsModelsName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.ProcureModelUserId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setProcureModelUserId(null); } else { dep_form_scrapped_model.setProcureModelUserId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.InitialCount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setInitialCount(null); } else { dep_form_scrapped_model.setInitialCount(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.UseCount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setUseCount(null); } else { dep_form_scrapped_model.setUseCount(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Counts); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setCounts(null); } else { dep_form_scrapped_model.setCounts(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.GoodsUserName); if (columnIndex > 0) { dep_form_scrapped_model.setGoodsUserName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Beiz); if (columnIndex > 0) { dep_form_scrapped_model.setBeiz(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.TotalAmount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { dep_form_scrapped_model.setTotalAmount(null); } else { dep_form_scrapped_model.setTotalAmount(rs.getInt(columnIndex)); } } return dep_form_scrapped_model; } }