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; /** * 表名:WH_WARNING * * @author genrator */ public class WhWarning_mapper extends WhWarning implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new WhWarningRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String WarehouseType = "warehouse_type"; public static final String BaseWarehouseId = "base_warehouse_id"; public static final String BaseWarehouseName = "base_warehouse_name"; public static final String BaseGoodsTemplateId = "base_goods_template_id"; public static final String BaseGoodsTemplateName = "base_goods_template_name"; public static final String BaseGoodsModelsId = "base_goods_models_id"; public static final String BaseGoodsModelsName = "base_goods_models_name"; public static final String GoodsType = "goods_type"; public static final String WarningType = "warning_type"; public static final String UpperLimit = "upper_limit"; public static final String LowerLimit = "lower_limit"; public static final String WarehouseCount = "warehouse_count"; public static final String WarningTime = "warning_time"; public static final String States = "states"; 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 AgencyId = "agency_id"; public static final String AgencyName = "agency_name"; /** * 默认构造函数 */ public WhWarning_mapper(WhWarning whWarning) { if (whWarning == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (whWarning.isset_id) { this.setId(whWarning.getId()); } //普通属性 if (whWarning.isset_warehouseType) { this.setWarehouseType(whWarning.getWarehouseType()); } if (whWarning.isset_baseWarehouseId) { this.setBaseWarehouseId(whWarning.getBaseWarehouseId()); } if (whWarning.isset_baseWarehouseName) { this.setBaseWarehouseName(whWarning.getBaseWarehouseName()); } if (whWarning.isset_baseGoodsTemplateId) { this.setBaseGoodsTemplateId(whWarning.getBaseGoodsTemplateId()); } if (whWarning.isset_baseGoodsTemplateName) { this.setBaseGoodsTemplateName(whWarning.getBaseGoodsTemplateName()); } if (whWarning.isset_baseGoodsModelsId) { this.setBaseGoodsModelsId(whWarning.getBaseGoodsModelsId()); } if (whWarning.isset_baseGoodsModelsName) { this.setBaseGoodsModelsName(whWarning.getBaseGoodsModelsName()); } if (whWarning.isset_goodsType) { this.setGoodsType(whWarning.getGoodsType()); } if (whWarning.isset_warningType) { this.setWarningType(whWarning.getWarningType()); } if (whWarning.isset_upperLimit) { this.setUpperLimit(whWarning.getUpperLimit()); } if (whWarning.isset_lowerLimit) { this.setLowerLimit(whWarning.getLowerLimit()); } if (whWarning.isset_warehouseCount) { this.setWarehouseCount(whWarning.getWarehouseCount()); } if (whWarning.isset_warningTime) { this.setWarningTime(whWarning.getWarningTime()); } if (whWarning.isset_states) { this.setStates(whWarning.getStates()); } if (whWarning.isset_operatorId) { this.setOperatorId(whWarning.getOperatorId()); } if (whWarning.isset_operatorName) { this.setOperatorName(whWarning.getOperatorName()); } if (whWarning.isset_dealTime) { this.setDealTime(whWarning.getDealTime()); } if (whWarning.isset_agencyId) { this.setAgencyId(whWarning.getAgencyId()); } if (whWarning.isset_agencyName) { this.setAgencyName(whWarning.getAgencyName()); } // 去掉,2022-09-07 // this.setDatabaseName_(wh_warning.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "wh_warning"; /** 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(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); ib.set(BaseWarehouseId, this.getBaseWarehouseId(), this.isset_baseWarehouseId); ib.set(BaseWarehouseName, this.getBaseWarehouseName(), this.isset_baseWarehouseName); ib.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ib.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName); ib.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ib.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ib.set(GoodsType, this.getGoodsType(), this.isset_goodsType); ib.set(WarningType, this.getWarningType(), this.isset_warningType); ib.set(UpperLimit, this.getUpperLimit(), this.isset_upperLimit); ib.set(LowerLimit, this.getLowerLimit(), this.isset_lowerLimit); ib.set(WarehouseCount, this.getWarehouseCount(), this.isset_warehouseCount); ib.set(WarningTime, this.getWarningTime(), this.isset_warningTime); ib.set(States, this.getStates(), this.isset_states); 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(AgencyId, this.getAgencyId(), this.isset_agencyId); ib.set(AgencyName, this.getAgencyName(), this.isset_agencyName); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); ub.set(BaseWarehouseId, this.getBaseWarehouseId(), this.isset_baseWarehouseId); ub.set(BaseWarehouseName, this.getBaseWarehouseName(), this.isset_baseWarehouseName); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(GoodsType, this.getGoodsType(), this.isset_goodsType); ub.set(WarningType, this.getWarningType(), this.isset_warningType); ub.set(UpperLimit, this.getUpperLimit(), this.isset_upperLimit); ub.set(LowerLimit, this.getLowerLimit(), this.isset_lowerLimit); ub.set(WarehouseCount, this.getWarehouseCount(), this.isset_warehouseCount); ub.set(WarningTime, this.getWarningTime(), this.isset_warningTime); ub.set(States, this.getStates(), this.isset_states); 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(AgencyId, this.getAgencyId(), this.isset_agencyId); ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); 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(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); ub.set(BaseWarehouseId, this.getBaseWarehouseId(), this.isset_baseWarehouseId); ub.set(BaseWarehouseName, this.getBaseWarehouseName(), this.isset_baseWarehouseName); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(GoodsType, this.getGoodsType(), this.isset_goodsType); ub.set(WarningType, this.getWarningType(), this.isset_warningType); ub.set(UpperLimit, this.getUpperLimit(), this.isset_upperLimit); ub.set(LowerLimit, this.getLowerLimit(), this.isset_lowerLimit); ub.set(WarehouseCount, this.getWarehouseCount(), this.isset_warehouseCount); ub.set(WarningTime, this.getWarningTime(), this.isset_warningTime); ub.set(States, this.getStates(), this.isset_states); 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(AgencyId, this.getAgencyId(), this.isset_agencyId); ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); ub.set(BaseWarehouseId, this.getBaseWarehouseId(), this.isset_baseWarehouseId); ub.set(BaseWarehouseName, this.getBaseWarehouseName(), this.isset_baseWarehouseName); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(GoodsType, this.getGoodsType(), this.isset_goodsType); ub.set(WarningType, this.getWarningType(), this.isset_warningType); ub.set(UpperLimit, this.getUpperLimit(), this.isset_upperLimit); ub.set(LowerLimit, this.getLowerLimit(), this.isset_lowerLimit); ub.set(WarehouseCount, this.getWarehouseCount(), this.isset_warehouseCount); ub.set(WarningTime, this.getWarningTime(), this.isset_warningTime); ub.set(States, this.getStates(), this.isset_states); 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(AgencyId, this.getAgencyId(), this.isset_agencyId); ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); 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, warehouse_type, base_warehouse_id, base_warehouse_name, base_goods_template_id, base_goods_template_name, base_goods_models_id, base_goods_models_name, goods_type, warning_type, upper_limit, lower_limit, warehouse_count, warning_time, states, operator_id, operator_name, deal_time, agency_id, agency_name from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, warehouse_type, base_warehouse_id, base_warehouse_name, base_goods_template_id, base_goods_template_name, base_goods_models_id, base_goods_models_name, goods_type, warning_type, upper_limit, lower_limit, warehouse_count, warning_time, states, operator_id, operator_name, deal_time, agency_id, agency_name from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public WhWarning mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public WhWarning toWhWarning() { return super.$clone(); } } /** * wh_warning RowMapper * * @author genrator */ class WhWarningRowMapper implements RowMapper { @Override public WhWarning mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); WhWarning wh_warning = new WhWarning(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.Id); if (columnIndex > 0) { wh_warning.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.WarehouseType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setWarehouseType(null); } else { wh_warning.setWarehouseType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.BaseWarehouseId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setBaseWarehouseId(null); } else { wh_warning.setBaseWarehouseId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.BaseWarehouseName); if (columnIndex > 0) { wh_warning.setBaseWarehouseName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.BaseGoodsTemplateId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setBaseGoodsTemplateId(null); } else { wh_warning.setBaseGoodsTemplateId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.BaseGoodsTemplateName); if (columnIndex > 0) { wh_warning.setBaseGoodsTemplateName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.BaseGoodsModelsId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setBaseGoodsModelsId(null); } else { wh_warning.setBaseGoodsModelsId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.BaseGoodsModelsName); if (columnIndex > 0) { wh_warning.setBaseGoodsModelsName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.GoodsType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setGoodsType(null); } else { wh_warning.setGoodsType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.WarningType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setWarningType(null); } else { wh_warning.setWarningType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.UpperLimit); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setUpperLimit(null); } else { wh_warning.setUpperLimit(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.LowerLimit); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setLowerLimit(null); } else { wh_warning.setLowerLimit(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.WarehouseCount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setWarehouseCount(null); } else { wh_warning.setWarehouseCount(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.WarningTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setWarningTime(null); } else { wh_warning.setWarningTime(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.States); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setStates(null); } else { wh_warning.setStates(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.OperatorId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setOperatorId(null); } else { wh_warning.setOperatorId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.OperatorName); if (columnIndex > 0) { wh_warning.setOperatorName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.DealTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setDealTime(null); } else { wh_warning.setDealTime(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.AgencyId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { wh_warning.setAgencyId(null); } else { wh_warning.setAgencyId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, WhWarning_mapper.AgencyName); if (columnIndex > 0) { wh_warning.setAgencyName(rs.getString(columnIndex)); } return wh_warning; } }