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 java.sql.ResultSet; import java.sql.SQLException; import java.util.Map; import org.springframework.jdbc.core.RowMapper; /** * 表名:L_WH_FORM_OUTPUT * * @author genrator */ public class LWhFormOutput_mapper extends LWhFormOutput implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new LWhFormOutputRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String WarehouseFlowId = "warehouse_flow_id"; public static final String BusinessFormCode = "business_form_code"; public static final String InWarehouseFlowId = "in_warehouse_flow_id"; public static final String TransBusinessId = "trans_business_id"; public static final String OutWarehouseType = "out_warehouse_type"; public static final String OutputCode = "output_code"; public static final String OutputName = "output_name"; public static final String WarehouseId = "warehouse_id"; public static final String WarehouseName = "warehouse_name"; public static final String InWarehouseType = "in_warehouse_type"; public static final String InWarehouseId = "in_warehouse_id"; public static final String InWarehouseName = "in_warehouse_name"; public static final String AgencyId = "agency_id"; public static final String AgencyName = "agency_name"; 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 States = "states"; public static final String Beiz = "beiz"; public static final String OutputDoc = "output_doc"; /** * 默认构造函数 */ public LWhFormOutput_mapper(LWhFormOutput lWhFormOutput) { if (lWhFormOutput == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (lWhFormOutput.isset_id) { this.setId(lWhFormOutput.getId()); } //普通属性 if (lWhFormOutput.isset_warehouseFlowId) { this.setWarehouseFlowId(lWhFormOutput.getWarehouseFlowId()); } if (lWhFormOutput.isset_businessFormCode) { this.setBusinessFormCode(lWhFormOutput.getBusinessFormCode()); } if (lWhFormOutput.isset_inWarehouseFlowId) { this.setInWarehouseFlowId(lWhFormOutput.getInWarehouseFlowId()); } if (lWhFormOutput.isset_transBusinessId) { this.setTransBusinessId(lWhFormOutput.getTransBusinessId()); } if (lWhFormOutput.isset_outWarehouseType) { this.setOutWarehouseType(lWhFormOutput.getOutWarehouseType()); } if (lWhFormOutput.isset_outputCode) { this.setOutputCode(lWhFormOutput.getOutputCode()); } if (lWhFormOutput.isset_outputName) { this.setOutputName(lWhFormOutput.getOutputName()); } if (lWhFormOutput.isset_warehouseId) { this.setWarehouseId(lWhFormOutput.getWarehouseId()); } if (lWhFormOutput.isset_warehouseName) { this.setWarehouseName(lWhFormOutput.getWarehouseName()); } if (lWhFormOutput.isset_inWarehouseType) { this.setInWarehouseType(lWhFormOutput.getInWarehouseType()); } if (lWhFormOutput.isset_inWarehouseId) { this.setInWarehouseId(lWhFormOutput.getInWarehouseId()); } if (lWhFormOutput.isset_inWarehouseName) { this.setInWarehouseName(lWhFormOutput.getInWarehouseName()); } if (lWhFormOutput.isset_agencyId) { this.setAgencyId(lWhFormOutput.getAgencyId()); } if (lWhFormOutput.isset_agencyName) { this.setAgencyName(lWhFormOutput.getAgencyName()); } if (lWhFormOutput.isset_operatorId) { this.setOperatorId(lWhFormOutput.getOperatorId()); } if (lWhFormOutput.isset_operatorName) { this.setOperatorName(lWhFormOutput.getOperatorName()); } if (lWhFormOutput.isset_dealTime) { this.setDealTime(lWhFormOutput.getDealTime()); } if (lWhFormOutput.isset_states) { this.setStates(lWhFormOutput.getStates()); } if (lWhFormOutput.isset_beiz) { this.setBeiz(lWhFormOutput.getBeiz()); } if (lWhFormOutput.isset_outputDoc) { this.setOutputDoc(lWhFormOutput.getOutputDoc()); } // 去掉,2022-09-07 // this.setDatabaseName_(l_wh_form_output.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "l_wh_form_output"; /** 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(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); ib.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ib.set(InWarehouseFlowId, this.getInWarehouseFlowId(), this.isset_inWarehouseFlowId); ib.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ib.set(OutWarehouseType, this.getOutWarehouseType(), this.isset_outWarehouseType); ib.set(OutputCode, this.getOutputCode(), this.isset_outputCode); ib.set(OutputName, this.getOutputName(), this.isset_outputName); ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ib.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); ib.set(InWarehouseType, this.getInWarehouseType(), this.isset_inWarehouseType); ib.set(InWarehouseId, this.getInWarehouseId(), this.isset_inWarehouseId); ib.set(InWarehouseName, this.getInWarehouseName(), this.isset_inWarehouseName); ib.set(AgencyId, this.getAgencyId(), this.isset_agencyId); ib.set(AgencyName, this.getAgencyName(), this.isset_agencyName); 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(States, this.getStates(), this.isset_states); ib.set(Beiz, this.getBeiz(), this.isset_beiz); ib.set(OutputDoc, this.getOutputDoc(), this.isset_outputDoc); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(InWarehouseFlowId, this.getInWarehouseFlowId(), this.isset_inWarehouseFlowId); ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ub.set(OutWarehouseType, this.getOutWarehouseType(), this.isset_outWarehouseType); ub.set(OutputCode, this.getOutputCode(), this.isset_outputCode); ub.set(OutputName, this.getOutputName(), this.isset_outputName); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); ub.set(InWarehouseType, this.getInWarehouseType(), this.isset_inWarehouseType); ub.set(InWarehouseId, this.getInWarehouseId(), this.isset_inWarehouseId); ub.set(InWarehouseName, this.getInWarehouseName(), this.isset_inWarehouseName); ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId); ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); 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(States, this.getStates(), this.isset_states); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(OutputDoc, this.getOutputDoc(), this.isset_outputDoc); 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(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(InWarehouseFlowId, this.getInWarehouseFlowId(), this.isset_inWarehouseFlowId); ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ub.set(OutWarehouseType, this.getOutWarehouseType(), this.isset_outWarehouseType); ub.set(OutputCode, this.getOutputCode(), this.isset_outputCode); ub.set(OutputName, this.getOutputName(), this.isset_outputName); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); ub.set(InWarehouseType, this.getInWarehouseType(), this.isset_inWarehouseType); ub.set(InWarehouseId, this.getInWarehouseId(), this.isset_inWarehouseId); ub.set(InWarehouseName, this.getInWarehouseName(), this.isset_inWarehouseName); ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId); ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); 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(States, this.getStates(), this.isset_states); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(OutputDoc, this.getOutputDoc(), this.isset_outputDoc); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(InWarehouseFlowId, this.getInWarehouseFlowId(), this.isset_inWarehouseFlowId); ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ub.set(OutWarehouseType, this.getOutWarehouseType(), this.isset_outWarehouseType); ub.set(OutputCode, this.getOutputCode(), this.isset_outputCode); ub.set(OutputName, this.getOutputName(), this.isset_outputName); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); ub.set(InWarehouseType, this.getInWarehouseType(), this.isset_inWarehouseType); ub.set(InWarehouseId, this.getInWarehouseId(), this.isset_inWarehouseId); ub.set(InWarehouseName, this.getInWarehouseName(), this.isset_inWarehouseName); ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId); ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); 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(States, this.getStates(), this.isset_states); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(OutputDoc, this.getOutputDoc(), this.isset_outputDoc); 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_flow_id, business_form_code, in_warehouse_flow_id, trans_business_id, out_warehouse_type, output_code, output_name, warehouse_id, warehouse_name, in_warehouse_type, in_warehouse_id, in_warehouse_name, agency_id, agency_name, operator_id, operator_name, deal_time, states, beiz from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, warehouse_flow_id, business_form_code, in_warehouse_flow_id, trans_business_id, out_warehouse_type, output_code, output_name, warehouse_id, warehouse_name, in_warehouse_type, in_warehouse_id, in_warehouse_name, agency_id, agency_name, operator_id, operator_name, deal_time, states, beiz from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public LWhFormOutput mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public LWhFormOutput toLWhFormOutput() { return super.$clone(); } } /** * l_wh_form_output RowMapper * * @author genrator */ class LWhFormOutputRowMapper implements RowMapper { @Override public LWhFormOutput mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); LWhFormOutput l_wh_form_output = new LWhFormOutput(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.Id); if (columnIndex > 0) { l_wh_form_output.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.WarehouseFlowId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setWarehouseFlowId(null); } else { l_wh_form_output.setWarehouseFlowId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.BusinessFormCode); if (columnIndex > 0) { l_wh_form_output.setBusinessFormCode(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.InWarehouseFlowId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setInWarehouseFlowId(null); } else { l_wh_form_output.setInWarehouseFlowId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.TransBusinessId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setTransBusinessId(null); } else { l_wh_form_output.setTransBusinessId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.OutWarehouseType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setOutWarehouseType(null); } else { l_wh_form_output.setOutWarehouseType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.OutputCode); if (columnIndex > 0) { l_wh_form_output.setOutputCode(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.OutputName); if (columnIndex > 0) { l_wh_form_output.setOutputName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.WarehouseId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setWarehouseId(null); } else { l_wh_form_output.setWarehouseId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.WarehouseName); if (columnIndex > 0) { l_wh_form_output.setWarehouseName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.InWarehouseType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setInWarehouseType(null); } else { l_wh_form_output.setInWarehouseType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.InWarehouseId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setInWarehouseId(null); } else { l_wh_form_output.setInWarehouseId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.InWarehouseName); if (columnIndex > 0) { l_wh_form_output.setInWarehouseName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.AgencyId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setAgencyId(null); } else { l_wh_form_output.setAgencyId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.AgencyName); if (columnIndex > 0) { l_wh_form_output.setAgencyName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.OperatorId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setOperatorId(null); } else { l_wh_form_output.setOperatorId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.OperatorName); if (columnIndex > 0) { l_wh_form_output.setOperatorName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.DealTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setDealTime(null); } else { l_wh_form_output.setDealTime(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.States); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_output.setStates(null); } else { l_wh_form_output.setStates(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.Beiz); if (columnIndex > 0) { l_wh_form_output.setBeiz(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormOutput_mapper.OutputDoc); if (columnIndex > 0) { l_wh_form_output.setOutputDoc(rs.getString(columnIndex)); } return l_wh_form_output; } }