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_PROCURE *
|
* @author genrator
|
*/
|
public class LWhFormProcure_mapper extends LWhFormProcure implements BaseMapper<LWhFormProcure> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<LWhFormProcure> ROW_MAPPER = new LWhFormProcureRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String BusinessFormCode = "business_form_code";
|
public static final String WarehouseId = "warehouse_id";
|
public static final String WarehouseName = "warehouse_name";
|
public static final String BuyerId = "buyer_id";
|
public static final String BuyerName = "buyer_name";
|
public static final String ProcureTime = "procure_time";
|
public static final String ProcureDoc = "procure_doc";
|
public static final String BuyType = "buy_type";
|
public static final String States = "states";
|
public static final String AgencyId = "agency_id";
|
public static final String AgencyName = "agency_name";
|
public static final String IncomeId = "income_id";
|
public static final String IncomeName = "income_name";
|
public static final String IncomeTime = "income_time";
|
public static final String Beiz = "beiz";
|
public static final String LWarehouseFlowId = "l_warehouse_flow_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public LWhFormProcure_mapper(LWhFormProcure lWhFormProcure) {
|
if (lWhFormProcure == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (lWhFormProcure.isset_id) {
|
this.setId(lWhFormProcure.getId());
|
}
|
//普通属性
|
if (lWhFormProcure.isset_businessFormCode) {
|
this.setBusinessFormCode(lWhFormProcure.getBusinessFormCode());
|
}
|
if (lWhFormProcure.isset_warehouseId) {
|
this.setWarehouseId(lWhFormProcure.getWarehouseId());
|
}
|
if (lWhFormProcure.isset_warehouseName) {
|
this.setWarehouseName(lWhFormProcure.getWarehouseName());
|
}
|
if (lWhFormProcure.isset_buyerId) {
|
this.setBuyerId(lWhFormProcure.getBuyerId());
|
}
|
if (lWhFormProcure.isset_buyerName) {
|
this.setBuyerName(lWhFormProcure.getBuyerName());
|
}
|
if (lWhFormProcure.isset_procureTime) {
|
this.setProcureTime(lWhFormProcure.getProcureTime());
|
}
|
if (lWhFormProcure.isset_procureDoc) {
|
this.setProcureDoc(lWhFormProcure.getProcureDoc());
|
}
|
if (lWhFormProcure.isset_buyType) {
|
this.setBuyType(lWhFormProcure.getBuyType());
|
}
|
if (lWhFormProcure.isset_states) {
|
this.setStates(lWhFormProcure.getStates());
|
}
|
if (lWhFormProcure.isset_agencyId) {
|
this.setAgencyId(lWhFormProcure.getAgencyId());
|
}
|
if (lWhFormProcure.isset_agencyName) {
|
this.setAgencyName(lWhFormProcure.getAgencyName());
|
}
|
if (lWhFormProcure.isset_incomeId) {
|
this.setIncomeId(lWhFormProcure.getIncomeId());
|
}
|
if (lWhFormProcure.isset_incomeName) {
|
this.setIncomeName(lWhFormProcure.getIncomeName());
|
}
|
if (lWhFormProcure.isset_incomeTime) {
|
this.setIncomeTime(lWhFormProcure.getIncomeTime());
|
}
|
if (lWhFormProcure.isset_beiz) {
|
this.setBeiz(lWhFormProcure.getBeiz());
|
}
|
if (lWhFormProcure.isset_lWarehouseFlowId) {
|
this.setLWarehouseFlowId(lWhFormProcure.getLWarehouseFlowId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(l_wh_form_procure.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "l_wh_form_procure";
|
/**
|
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<Map<String, Object>> getInsertSql_() {
|
InsertBuilder ib = new InsertBuilder(this.getTableName_());
|
ib.set(Id, this.getId());
|
ib.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ib.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ib.set(BuyerId, this.getBuyerId(), this.isset_buyerId);
|
ib.set(BuyerName, this.getBuyerName(), this.isset_buyerName);
|
ib.set(ProcureTime, this.getProcureTime(), this.isset_procureTime);
|
ib.set(ProcureDoc, this.getProcureDoc(), this.isset_procureDoc);
|
ib.set(BuyType, this.getBuyType(), this.isset_buyType);
|
ib.set(States, this.getStates(), this.isset_states);
|
ib.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ib.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ib.set(IncomeId, this.getIncomeId(), this.isset_incomeId);
|
ib.set(IncomeName, this.getIncomeName(), this.isset_incomeName);
|
ib.set(IncomeTime, this.getIncomeTime(), this.isset_incomeTime);
|
ib.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ib.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(BuyerId, this.getBuyerId(), this.isset_buyerId);
|
ub.set(BuyerName, this.getBuyerName(), this.isset_buyerName);
|
ub.set(ProcureTime, this.getProcureTime(), this.isset_procureTime);
|
ub.set(ProcureDoc, this.getProcureDoc(), this.isset_procureDoc);
|
ub.set(BuyType, this.getBuyType(), this.isset_buyType);
|
ub.set(States, this.getStates(), this.isset_states);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(IncomeId, this.getIncomeId(), this.isset_incomeId);
|
ub.set(IncomeName, this.getIncomeName(), this.isset_incomeName);
|
ub.set(IncomeTime, this.getIncomeTime(), this.isset_incomeTime);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId);
|
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(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(BuyerId, this.getBuyerId(), this.isset_buyerId);
|
ub.set(BuyerName, this.getBuyerName(), this.isset_buyerName);
|
ub.set(ProcureTime, this.getProcureTime(), this.isset_procureTime);
|
ub.set(ProcureDoc, this.getProcureDoc(), this.isset_procureDoc);
|
ub.set(BuyType, this.getBuyType(), this.isset_buyType);
|
ub.set(States, this.getStates(), this.isset_states);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(IncomeId, this.getIncomeId(), this.isset_incomeId);
|
ub.set(IncomeName, this.getIncomeName(), this.isset_incomeName);
|
ub.set(IncomeTime, this.getIncomeTime(), this.isset_incomeTime);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(BuyerId, this.getBuyerId(), this.isset_buyerId);
|
ub.set(BuyerName, this.getBuyerName(), this.isset_buyerName);
|
ub.set(ProcureTime, this.getProcureTime(), this.isset_procureTime);
|
ub.set(ProcureDoc, this.getProcureDoc(), this.isset_procureDoc);
|
ub.set(BuyType, this.getBuyType(), this.isset_buyType);
|
ub.set(States, this.getStates(), this.isset_states);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(IncomeId, this.getIncomeId(), this.isset_incomeId);
|
ub.set(IncomeName, this.getIncomeName(), this.isset_incomeName);
|
ub.set(IncomeTime, this.getIncomeTime(), this.isset_incomeTime);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId);
|
return ub.genArraySql(where, parameters);
|
}
|
|
/**
|
* 获取删除语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getDeleteSql_() {
|
DeleteBuilder db = new DeleteBuilder(this.getTableName_());
|
db.where(this.getPkName_(), this.getPkValue_());
|
return db.genMapSql();
|
}
|
|
/**
|
* 获取删除语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getDeleteSql_(String where, Map<String, Object> parameters) {
|
DeleteBuilder db = new DeleteBuilder(this.getTableName_());
|
return db.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取删除语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getDeleteSql_(String where, Object[] parameters) {
|
DeleteBuilder db = new DeleteBuilder(this.getTableName_());
|
return db.genArraySql(where, parameters);
|
}
|
|
/**
|
* 获取单行查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getSingleSql_() {
|
SelectBuilder sb = new SelectBuilder(this.getTableName_());
|
sb.where(this.getPkName_(), this.getPkValue_());
|
return sb.genMapSql();
|
}
|
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) {
|
return new SqlAndParameters<>("select id, business_form_code, warehouse_id, warehouse_name, buyer_id, buyer_name, procure_time, procure_doc, buy_type, states, agency_id, agency_name, income_id, income_name, income_time, beiz, l_warehouse_flow_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, business_form_code, warehouse_id, warehouse_name, buyer_id, buyer_name, procure_time, procure_doc, buy_type, states, agency_id, agency_name, income_id, income_name, income_time, beiz, l_warehouse_flow_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public LWhFormProcure mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public LWhFormProcure toLWhFormProcure() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* l_wh_form_procure RowMapper
|
*
|
* @author genrator
|
*/
|
class LWhFormProcureRowMapper implements RowMapper<LWhFormProcure> {
|
|
@Override
|
public LWhFormProcure mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
LWhFormProcure l_wh_form_procure = new LWhFormProcure();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.Id);
|
if (columnIndex > 0) {
|
l_wh_form_procure.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.BusinessFormCode);
|
if (columnIndex > 0) {
|
l_wh_form_procure.setBusinessFormCode(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.WarehouseId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure.setWarehouseId(null);
|
} else {
|
l_wh_form_procure.setWarehouseId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.WarehouseName);
|
if (columnIndex > 0) {
|
l_wh_form_procure.setWarehouseName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.BuyerId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure.setBuyerId(null);
|
} else {
|
l_wh_form_procure.setBuyerId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.BuyerName);
|
if (columnIndex > 0) {
|
l_wh_form_procure.setBuyerName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.ProcureTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure.setProcureTime(null);
|
} else {
|
l_wh_form_procure.setProcureTime(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.ProcureDoc);
|
if (columnIndex > 0) {
|
l_wh_form_procure.setProcureDoc(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.BuyType);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure.setBuyType(null);
|
} else {
|
l_wh_form_procure.setBuyType(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.States);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure.setStates(null);
|
} else {
|
l_wh_form_procure.setStates(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.AgencyId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure.setAgencyId(null);
|
} else {
|
l_wh_form_procure.setAgencyId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.AgencyName);
|
if (columnIndex > 0) {
|
l_wh_form_procure.setAgencyName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.IncomeId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure.setIncomeId(null);
|
} else {
|
l_wh_form_procure.setIncomeId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.IncomeName);
|
if (columnIndex > 0) {
|
l_wh_form_procure.setIncomeName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.IncomeTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure.setIncomeTime(null);
|
} else {
|
l_wh_form_procure.setIncomeTime(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.Beiz);
|
if (columnIndex > 0) {
|
l_wh_form_procure.setBeiz(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcure_mapper.LWarehouseFlowId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure.setLWarehouseFlowId(null);
|
} else {
|
l_wh_form_procure.setLWarehouseFlowId(rs.getLong(columnIndex));
|
}
|
}
|
return l_wh_form_procure;
|
}
|
}
|