| | |
| | | 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; |
| | |
| | | // 主键 |
| | | public static final String Id = "id"; |
| | | // 普通属性 |
| | | public static final String LWarehouseFlowId = "l_warehouse_flow_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 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"; |
| | | |
| | | /** |
| | | * 默认构造函数 |
| | |
| | | this.setId(lWhGoodsRecord.getId()); |
| | | } |
| | | //普通属性 |
| | | if (lWhGoodsRecord.isset_lWarehouseFlowId) { |
| | | this.setLWarehouseFlowId(lWhGoodsRecord.getLWarehouseFlowId()); |
| | | if (lWhGoodsRecord.isset_warehouseId) { |
| | | this.setWarehouseId(lWhGoodsRecord.getWarehouseId()); |
| | | } |
| | | if (lWhGoodsRecord.isset_warehouseFlowId) { |
| | | this.setWarehouseFlowId(lWhGoodsRecord.getWarehouseFlowId()); |
| | |
| | | } |
| | | 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_()); |
| | |
| | | public SqlAndParameters<Map<String, Object>> getInsertSql_() { |
| | | InsertBuilder ib = new InsertBuilder(this.getTableName_()); |
| | | ib.set(Id, this.getId()); |
| | | ib.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); |
| | | 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(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<Map<String, Object>> getUpdateSql_() { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); |
| | | 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(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<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); |
| | | 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(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<Object[]> getUpdateSql_(String where, Object[] parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); |
| | | 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(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<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, l_warehouse_flow_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 from " + this.getTableName_() + " " + where, 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<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, l_warehouse_flow_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 from " + this.getTableName_() + " " + where, 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); |
| | | } |
| | | |
| | | /** |
| | |
| | | l_wh_goods_record.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.LWarehouseFlowId); |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.WarehouseId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_goods_record.setLWarehouseFlowId(null); |
| | | l_wh_goods_record.setWarehouseId(null); |
| | | } else { |
| | | l_wh_goods_record.setLWarehouseFlowId(rs.getLong(columnIndex)); |
| | | l_wh_goods_record.setWarehouseId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.WarehouseFlowId); |
| | |
| | | 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; |
| | | } |
| | | } |