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; /** * 表名:L_WH_FORM_SCRAPPED * * @author genrator */ public class LWhFormScrapped_mapper extends LWhFormScrapped implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new LWhFormScrappedRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String LWarehouseFlowId = "l_warehouse_flow_id"; public static final String BusinessFormCode = "business_form_code"; public static final String WarehouseType = "warehouse_type"; public static final String WarehouseId = "warehouse_id"; public static final String WarehouseName = "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 DepartmentId = "department_id"; public static final String DepartmentName = "department_name"; public static final String UploadFiles = "upload_files"; public static final String States = "states"; /** * 默认构造函数 */ public LWhFormScrapped_mapper(LWhFormScrapped lWhFormScrapped) { if (lWhFormScrapped == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (lWhFormScrapped.isset_id) { this.setId(lWhFormScrapped.getId()); } //普通属性 if (lWhFormScrapped.isset_lWarehouseFlowId) { this.setLWarehouseFlowId(lWhFormScrapped.getLWarehouseFlowId()); } if (lWhFormScrapped.isset_businessFormCode) { this.setBusinessFormCode(lWhFormScrapped.getBusinessFormCode()); } if (lWhFormScrapped.isset_warehouseType) { this.setWarehouseType(lWhFormScrapped.getWarehouseType()); } if (lWhFormScrapped.isset_warehouseId) { this.setWarehouseId(lWhFormScrapped.getWarehouseId()); } if (lWhFormScrapped.isset_warehouseName) { this.setWarehouseName(lWhFormScrapped.getWarehouseName()); } if (lWhFormScrapped.isset_agencyId) { this.setAgencyId(lWhFormScrapped.getAgencyId()); } if (lWhFormScrapped.isset_agencyName) { this.setAgencyName(lWhFormScrapped.getAgencyName()); } if (lWhFormScrapped.isset_operatorId) { this.setOperatorId(lWhFormScrapped.getOperatorId()); } if (lWhFormScrapped.isset_operatorName) { this.setOperatorName(lWhFormScrapped.getOperatorName()); } if (lWhFormScrapped.isset_dealTime) { this.setDealTime(lWhFormScrapped.getDealTime()); } if (lWhFormScrapped.isset_departmentId) { this.setDepartmentId(lWhFormScrapped.getDepartmentId()); } if (lWhFormScrapped.isset_departmentName) { this.setDepartmentName(lWhFormScrapped.getDepartmentName()); } if (lWhFormScrapped.isset_uploadFiles) { this.setUploadFiles(lWhFormScrapped.getUploadFiles()); } if (lWhFormScrapped.isset_states) { this.setStates(lWhFormScrapped.getStates()); } // 去掉,2022-09-07 // this.setDatabaseName_(l_wh_form_scrapped.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "l_wh_form_scrapped"; /** 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(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); ib.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ib.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ib.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); 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(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ib.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); ib.set(UploadFiles, this.getUploadFiles(), this.isset_uploadFiles); ib.set(States, this.getStates(), this.isset_states); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); 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(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); ub.set(UploadFiles, this.getUploadFiles(), this.isset_uploadFiles); ub.set(States, this.getStates(), this.isset_states); 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(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); 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(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); ub.set(UploadFiles, this.getUploadFiles(), this.isset_uploadFiles); ub.set(States, this.getStates(), this.isset_states); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); 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(DepartmentId, this.getDepartmentId(), this.isset_departmentId); ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName); ub.set(UploadFiles, this.getUploadFiles(), this.isset_uploadFiles); ub.set(States, this.getStates(), this.isset_states); 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, l_warehouse_flow_id, business_form_code, warehouse_type, warehouse_id, warehouse_name, agency_id, agency_name, operator_id, operator_name, deal_time, department_id, department_name, upload_files, states from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, l_warehouse_flow_id, business_form_code, warehouse_type, warehouse_id, warehouse_name, agency_id, agency_name, operator_id, operator_name, deal_time, department_id, department_name, upload_files, states from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public LWhFormScrapped mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public LWhFormScrapped toLWhFormScrapped() { return super.$clone(); } } /** * l_wh_form_scrapped RowMapper * * @author genrator */ class LWhFormScrappedRowMapper implements RowMapper { @Override public LWhFormScrapped mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); LWhFormScrapped l_wh_form_scrapped = new LWhFormScrapped(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.Id); if (columnIndex > 0) { l_wh_form_scrapped.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.LWarehouseFlowId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped.setLWarehouseFlowId(null); } else { l_wh_form_scrapped.setLWarehouseFlowId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.BusinessFormCode); if (columnIndex > 0) { l_wh_form_scrapped.setBusinessFormCode(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.WarehouseType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped.setWarehouseType(null); } else { l_wh_form_scrapped.setWarehouseType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.WarehouseId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped.setWarehouseId(null); } else { l_wh_form_scrapped.setWarehouseId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.WarehouseName); if (columnIndex > 0) { l_wh_form_scrapped.setWarehouseName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.AgencyId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped.setAgencyId(null); } else { l_wh_form_scrapped.setAgencyId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.AgencyName); if (columnIndex > 0) { l_wh_form_scrapped.setAgencyName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.OperatorId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped.setOperatorId(null); } else { l_wh_form_scrapped.setOperatorId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.OperatorName); if (columnIndex > 0) { l_wh_form_scrapped.setOperatorName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.DealTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped.setDealTime(null); } else { l_wh_form_scrapped.setDealTime(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.DepartmentId); if (columnIndex > 0) { l_wh_form_scrapped.setDepartmentId(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.DepartmentName); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped.setDepartmentName(null); } else { l_wh_form_scrapped.setDepartmentName(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.UploadFiles); if (columnIndex > 0) { l_wh_form_scrapped.setUploadFiles(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.States); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped.setStates(null); } else { l_wh_form_scrapped.setStates(rs.getInt(columnIndex)); } } return l_wh_form_scrapped; } }