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;
|
|
/**
|
* 表名:WH_FORM_PROCURE_MODEL *
|
* @author genrator
|
*/
|
public class WhFormProcureModel_mapper extends WhFormProcureModel implements BaseMapper<WhFormProcureModel> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<WhFormProcureModel> ROW_MAPPER = new WhFormProcureModelRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String BaseGoodsTemplateId = "base_goods_template_id";
|
public static final String GoodsTemplateName = "goods_template_name";
|
public static final String Supplier = "supplier";
|
public static final String BaseGoodsModelsId = "base_goods_models_id";
|
public static final String BaseGoodsModelsName = "base_goods_models_name";
|
public static final String Unit = "unit";
|
public static final String Price = "price";
|
public static final String Counts = "counts";
|
public static final String WhFormProcureId = "wh_form_procure_id";
|
public static final String WhFormProcureGoodsId = "wh_form_procure_goods_id";
|
public static final String InWhGoodsDetailsId = "in_wh_goods_details_id";
|
public static final String Beiz = "beiz";
|
public static final String WhGoodsId = "wh_goods_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public WhFormProcureModel_mapper(WhFormProcureModel whFormProcureModel) {
|
if (whFormProcureModel == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (whFormProcureModel.isset_id) {
|
this.setId(whFormProcureModel.getId());
|
}
|
//普通属性
|
if (whFormProcureModel.isset_baseGoodsTemplateId) {
|
this.setBaseGoodsTemplateId(whFormProcureModel.getBaseGoodsTemplateId());
|
}
|
if (whFormProcureModel.isset_goodsTemplateName) {
|
this.setGoodsTemplateName(whFormProcureModel.getGoodsTemplateName());
|
}
|
if (whFormProcureModel.isset_supplier) {
|
this.setSupplier(whFormProcureModel.getSupplier());
|
}
|
if (whFormProcureModel.isset_baseGoodsModelsId) {
|
this.setBaseGoodsModelsId(whFormProcureModel.getBaseGoodsModelsId());
|
}
|
if (whFormProcureModel.isset_baseGoodsModelsName) {
|
this.setBaseGoodsModelsName(whFormProcureModel.getBaseGoodsModelsName());
|
}
|
if (whFormProcureModel.isset_unit) {
|
this.setUnit(whFormProcureModel.getUnit());
|
}
|
if (whFormProcureModel.isset_price) {
|
this.setPrice(whFormProcureModel.getPrice());
|
}
|
if (whFormProcureModel.isset_counts) {
|
this.setCounts(whFormProcureModel.getCounts());
|
}
|
if (whFormProcureModel.isset_whFormProcureId) {
|
this.setWhFormProcureId(whFormProcureModel.getWhFormProcureId());
|
}
|
if (whFormProcureModel.isset_whFormProcureGoodsId) {
|
this.setWhFormProcureGoodsId(whFormProcureModel.getWhFormProcureGoodsId());
|
}
|
if (whFormProcureModel.isset_inWhGoodsDetailsId) {
|
this.setInWhGoodsDetailsId(whFormProcureModel.getInWhGoodsDetailsId());
|
}
|
if (whFormProcureModel.isset_beiz) {
|
this.setBeiz(whFormProcureModel.getBeiz());
|
}
|
if (whFormProcureModel.isset_whGoodsId) {
|
this.setWhGoodsId(whFormProcureModel.getWhGoodsId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(wh_form_procure_model.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "wh_form_procure_model";
|
/**
|
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(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ib.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ib.set(Supplier, this.getSupplier(), this.isset_supplier);
|
ib.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ib.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ib.set(Unit, this.getUnit(), this.isset_unit);
|
ib.set(Price, this.getPrice(), this.isset_price);
|
ib.set(Counts, this.getCounts(), this.isset_counts);
|
ib.set(WhFormProcureId, this.getWhFormProcureId(), this.isset_whFormProcureId);
|
ib.set(WhFormProcureGoodsId, this.getWhFormProcureGoodsId(), this.isset_whFormProcureGoodsId);
|
ib.set(InWhGoodsDetailsId, this.getInWhGoodsDetailsId(), this.isset_inWhGoodsDetailsId);
|
ib.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ib.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Supplier, this.getSupplier(), this.isset_supplier);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ub.set(Unit, this.getUnit(), this.isset_unit);
|
ub.set(Price, this.getPrice(), this.isset_price);
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(WhFormProcureId, this.getWhFormProcureId(), this.isset_whFormProcureId);
|
ub.set(WhFormProcureGoodsId, this.getWhFormProcureGoodsId(), this.isset_whFormProcureGoodsId);
|
ub.set(InWhGoodsDetailsId, this.getInWhGoodsDetailsId(), this.isset_inWhGoodsDetailsId);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
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(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Supplier, this.getSupplier(), this.isset_supplier);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ub.set(Unit, this.getUnit(), this.isset_unit);
|
ub.set(Price, this.getPrice(), this.isset_price);
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(WhFormProcureId, this.getWhFormProcureId(), this.isset_whFormProcureId);
|
ub.set(WhFormProcureGoodsId, this.getWhFormProcureGoodsId(), this.isset_whFormProcureGoodsId);
|
ub.set(InWhGoodsDetailsId, this.getInWhGoodsDetailsId(), this.isset_inWhGoodsDetailsId);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Supplier, this.getSupplier(), this.isset_supplier);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ub.set(Unit, this.getUnit(), this.isset_unit);
|
ub.set(Price, this.getPrice(), this.isset_price);
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(WhFormProcureId, this.getWhFormProcureId(), this.isset_whFormProcureId);
|
ub.set(WhFormProcureGoodsId, this.getWhFormProcureGoodsId(), this.isset_whFormProcureGoodsId);
|
ub.set(InWhGoodsDetailsId, this.getInWhGoodsDetailsId(), this.isset_inWhGoodsDetailsId);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
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, base_goods_template_id, goods_template_name, supplier, base_goods_models_id, base_goods_models_name, unit, price, counts, wh_form_procure_id, wh_form_procure_goods_id, in_wh_goods_details_id, beiz, wh_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, base_goods_template_id, goods_template_name, supplier, base_goods_models_id, base_goods_models_name, unit, price, counts, wh_form_procure_id, wh_form_procure_goods_id, in_wh_goods_details_id, beiz, wh_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public WhFormProcureModel mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public WhFormProcureModel toWhFormProcureModel() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* wh_form_procure_model RowMapper
|
*
|
* @author genrator
|
*/
|
class WhFormProcureModelRowMapper implements RowMapper<WhFormProcureModel> {
|
|
@Override
|
public WhFormProcureModel mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
WhFormProcureModel wh_form_procure_model = new WhFormProcureModel();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.Id);
|
if (columnIndex > 0) {
|
wh_form_procure_model.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.BaseGoodsTemplateId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_procure_model.setBaseGoodsTemplateId(null);
|
} else {
|
wh_form_procure_model.setBaseGoodsTemplateId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.GoodsTemplateName);
|
if (columnIndex > 0) {
|
wh_form_procure_model.setGoodsTemplateName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.Supplier);
|
if (columnIndex > 0) {
|
wh_form_procure_model.setSupplier(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.BaseGoodsModelsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_procure_model.setBaseGoodsModelsId(null);
|
} else {
|
wh_form_procure_model.setBaseGoodsModelsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.BaseGoodsModelsName);
|
if (columnIndex > 0) {
|
wh_form_procure_model.setBaseGoodsModelsName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.Unit);
|
if (columnIndex > 0) {
|
wh_form_procure_model.setUnit(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.Price);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_procure_model.setPrice(null);
|
} else {
|
wh_form_procure_model.setPrice(rs.getDouble(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.Counts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_procure_model.setCounts(null);
|
} else {
|
wh_form_procure_model.setCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.WhFormProcureId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_procure_model.setWhFormProcureId(null);
|
} else {
|
wh_form_procure_model.setWhFormProcureId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.WhFormProcureGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_procure_model.setWhFormProcureGoodsId(null);
|
} else {
|
wh_form_procure_model.setWhFormProcureGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.InWhGoodsDetailsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_procure_model.setInWhGoodsDetailsId(null);
|
} else {
|
wh_form_procure_model.setInWhGoodsDetailsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.Beiz);
|
if (columnIndex > 0) {
|
wh_form_procure_model.setBeiz(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormProcureModel_mapper.WhGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_procure_model.setWhGoodsId(null);
|
} else {
|
wh_form_procure_model.setWhGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
return wh_form_procure_model;
|
}
|
}
|