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; /** * 表名:L_WH_GOODS_RECORD * * @author genrator */ public class LWhGoodsRecord_mapper extends LWhGoodsRecord implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new LWhGoodsRecordRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String WarehouseId = "warehouse_id"; public static final String WarehouseFlowId = "warehouse_flow_id"; public static final String InitialCount = "initial_count"; public static final String ThisType = "this_type"; public static final String ThisCount = "this_count"; public static final String EndCount = "end_count"; public static final String BaseGoodsTemplateId = "base_goods_template_id"; public static final String GoodsTemplateName = "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 DealTime = "deal_time"; /** * 默认构造函数 */ public LWhGoodsRecord_mapper(LWhGoodsRecord lWhGoodsRecord) { if (lWhGoodsRecord == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (lWhGoodsRecord.isset_id) { this.setId(lWhGoodsRecord.getId()); } //普通属性 if (lWhGoodsRecord.isset_warehouseId) { this.setWarehouseId(lWhGoodsRecord.getWarehouseId()); } if (lWhGoodsRecord.isset_warehouseFlowId) { this.setWarehouseFlowId(lWhGoodsRecord.getWarehouseFlowId()); } if (lWhGoodsRecord.isset_initialCount) { this.setInitialCount(lWhGoodsRecord.getInitialCount()); } if (lWhGoodsRecord.isset_thisType) { this.setThisType(lWhGoodsRecord.getThisType()); } if (lWhGoodsRecord.isset_thisCount) { this.setThisCount(lWhGoodsRecord.getThisCount()); } if (lWhGoodsRecord.isset_endCount) { this.setEndCount(lWhGoodsRecord.getEndCount()); } if (lWhGoodsRecord.isset_baseGoodsTemplateId) { this.setBaseGoodsTemplateId(lWhGoodsRecord.getBaseGoodsTemplateId()); } if (lWhGoodsRecord.isset_goodsTemplateName) { this.setGoodsTemplateName(lWhGoodsRecord.getGoodsTemplateName()); } if (lWhGoodsRecord.isset_baseGoodsModelsId) { this.setBaseGoodsModelsId(lWhGoodsRecord.getBaseGoodsModelsId()); } if (lWhGoodsRecord.isset_baseGoodsModelsName) { this.setBaseGoodsModelsName(lWhGoodsRecord.getBaseGoodsModelsName()); } if (lWhGoodsRecord.isset_dealTime) { this.setDealTime(lWhGoodsRecord.getDealTime()); } // 去掉,2022-09-07 // this.setDatabaseName_(l_wh_goods_record.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "l_wh_goods_record"; /** 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(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ib.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); ib.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ib.set(ThisType, this.getThisType(), this.isset_thisType); ib.set(ThisCount, this.getThisCount(), this.isset_thisCount); ib.set(EndCount, this.getEndCount(), this.isset_endCount); ib.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ib.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName); ib.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ib.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ib.set(DealTime, this.getDealTime(), this.isset_dealTime); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ub.set(ThisType, this.getThisType(), this.isset_thisType); ub.set(ThisCount, this.getThisCount(), this.isset_thisCount); ub.set(EndCount, this.getEndCount(), this.isset_endCount); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(DealTime, this.getDealTime(), this.isset_dealTime); 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(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ub.set(ThisType, this.getThisType(), this.isset_thisType); ub.set(ThisCount, this.getThisCount(), this.isset_thisCount); ub.set(EndCount, this.getEndCount(), this.isset_endCount); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(DealTime, this.getDealTime(), this.isset_dealTime); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); ub.set(ThisType, this.getThisType(), this.isset_thisType); ub.set(ThisCount, this.getThisCount(), this.isset_thisCount); ub.set(EndCount, this.getEndCount(), this.isset_endCount); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(DealTime, this.getDealTime(), this.isset_dealTime); 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_id, warehouse_flow_id, initial_count, this_type, this_count, end_count, base_goods_template_id, goods_template_name, base_goods_models_id, base_goods_models_name, deal_time from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, warehouse_id, warehouse_flow_id, initial_count, this_type, this_count, end_count, base_goods_template_id, goods_template_name, base_goods_models_id, base_goods_models_name, deal_time from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public LWhGoodsRecord mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public LWhGoodsRecord toLWhGoodsRecord() { return super.$clone(); } } /** * l_wh_goods_record RowMapper * * @author genrator */ class LWhGoodsRecordRowMapper implements RowMapper { @Override public LWhGoodsRecord mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); LWhGoodsRecord l_wh_goods_record = new LWhGoodsRecord(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.Id); if (columnIndex > 0) { l_wh_goods_record.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.WarehouseId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_goods_record.setWarehouseId(null); } else { l_wh_goods_record.setWarehouseId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.WarehouseFlowId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_goods_record.setWarehouseFlowId(null); } else { l_wh_goods_record.setWarehouseFlowId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.InitialCount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_goods_record.setInitialCount(null); } else { l_wh_goods_record.setInitialCount(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.ThisType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_goods_record.setThisType(null); } else { l_wh_goods_record.setThisType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.ThisCount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_goods_record.setThisCount(null); } else { l_wh_goods_record.setThisCount(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.EndCount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_goods_record.setEndCount(null); } else { l_wh_goods_record.setEndCount(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.BaseGoodsTemplateId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_goods_record.setBaseGoodsTemplateId(null); } else { l_wh_goods_record.setBaseGoodsTemplateId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.GoodsTemplateName); if (columnIndex > 0) { l_wh_goods_record.setGoodsTemplateName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.BaseGoodsModelsId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_goods_record.setBaseGoodsModelsId(null); } else { l_wh_goods_record.setBaseGoodsModelsId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.BaseGoodsModelsName); if (columnIndex > 0) { l_wh_goods_record.setBaseGoodsModelsName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.DealTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_goods_record.setDealTime(null); } else { l_wh_goods_record.setDealTime(rs.getLong(columnIndex)); } } return l_wh_goods_record; } }