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_INVENTORY_GOODS *
|
* @author genrator
|
*/
|
public class WhFormInventoryGoods_mapper extends WhFormInventoryGoods implements BaseMapper<WhFormInventoryGoods> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<WhFormInventoryGoods> ROW_MAPPER = new WhFormInventoryGoodsRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String WhFormInventoryId = "wh_form_inventory_id";
|
public static final String BaseGoodsTemplateId = "base_goods_template_id";
|
public static final String GoodsTemplateName = "goods_template_name";
|
public static final String Unit = "unit";
|
public static final String BaseGoodsModelsId = "base_goods_models_id";
|
public static final String BaseGoodsModelsName = "base_goods_models_name";
|
public static final String InitCounts = "init_counts";
|
public static final String InventoryCounts = "inventory_counts";
|
public static final String ErrorCounts = "error_counts";
|
public static final String InventoryResult = "inventory_result";
|
|
/**
|
* 默认构造函数
|
*/
|
public WhFormInventoryGoods_mapper(WhFormInventoryGoods whFormInventoryGoods) {
|
if (whFormInventoryGoods == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (whFormInventoryGoods.isset_id) {
|
this.setId(whFormInventoryGoods.getId());
|
}
|
//普通属性
|
if (whFormInventoryGoods.isset_whFormInventoryId) {
|
this.setWhFormInventoryId(whFormInventoryGoods.getWhFormInventoryId());
|
}
|
if (whFormInventoryGoods.isset_baseGoodsTemplateId) {
|
this.setBaseGoodsTemplateId(whFormInventoryGoods.getBaseGoodsTemplateId());
|
}
|
if (whFormInventoryGoods.isset_goodsTemplateName) {
|
this.setGoodsTemplateName(whFormInventoryGoods.getGoodsTemplateName());
|
}
|
if (whFormInventoryGoods.isset_unit) {
|
this.setUnit(whFormInventoryGoods.getUnit());
|
}
|
if (whFormInventoryGoods.isset_baseGoodsModelsId) {
|
this.setBaseGoodsModelsId(whFormInventoryGoods.getBaseGoodsModelsId());
|
}
|
if (whFormInventoryGoods.isset_baseGoodsModelsName) {
|
this.setBaseGoodsModelsName(whFormInventoryGoods.getBaseGoodsModelsName());
|
}
|
if (whFormInventoryGoods.isset_initCounts) {
|
this.setInitCounts(whFormInventoryGoods.getInitCounts());
|
}
|
if (whFormInventoryGoods.isset_inventoryCounts) {
|
this.setInventoryCounts(whFormInventoryGoods.getInventoryCounts());
|
}
|
if (whFormInventoryGoods.isset_errorCounts) {
|
this.setErrorCounts(whFormInventoryGoods.getErrorCounts());
|
}
|
if (whFormInventoryGoods.isset_inventoryResult) {
|
this.setInventoryResult(whFormInventoryGoods.getInventoryResult());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(wh_form_inventory_goods.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "wh_form_inventory_goods";
|
/**
|
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(WhFormInventoryId, this.getWhFormInventoryId(), this.isset_whFormInventoryId);
|
ib.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ib.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ib.set(Unit, this.getUnit(), this.isset_unit);
|
ib.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ib.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ib.set(InitCounts, this.getInitCounts(), this.isset_initCounts);
|
ib.set(InventoryCounts, this.getInventoryCounts(), this.isset_inventoryCounts);
|
ib.set(ErrorCounts, this.getErrorCounts(), this.isset_errorCounts);
|
ib.set(InventoryResult, this.getInventoryResult(), this.isset_inventoryResult);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(WhFormInventoryId, this.getWhFormInventoryId(), this.isset_whFormInventoryId);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Unit, this.getUnit(), this.isset_unit);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ub.set(InitCounts, this.getInitCounts(), this.isset_initCounts);
|
ub.set(InventoryCounts, this.getInventoryCounts(), this.isset_inventoryCounts);
|
ub.set(ErrorCounts, this.getErrorCounts(), this.isset_errorCounts);
|
ub.set(InventoryResult, this.getInventoryResult(), this.isset_inventoryResult);
|
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(WhFormInventoryId, this.getWhFormInventoryId(), this.isset_whFormInventoryId);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Unit, this.getUnit(), this.isset_unit);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ub.set(InitCounts, this.getInitCounts(), this.isset_initCounts);
|
ub.set(InventoryCounts, this.getInventoryCounts(), this.isset_inventoryCounts);
|
ub.set(ErrorCounts, this.getErrorCounts(), this.isset_errorCounts);
|
ub.set(InventoryResult, this.getInventoryResult(), this.isset_inventoryResult);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(WhFormInventoryId, this.getWhFormInventoryId(), this.isset_whFormInventoryId);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Unit, this.getUnit(), this.isset_unit);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ub.set(InitCounts, this.getInitCounts(), this.isset_initCounts);
|
ub.set(InventoryCounts, this.getInventoryCounts(), this.isset_inventoryCounts);
|
ub.set(ErrorCounts, this.getErrorCounts(), this.isset_errorCounts);
|
ub.set(InventoryResult, this.getInventoryResult(), this.isset_inventoryResult);
|
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, wh_form_inventory_id, base_goods_template_id, goods_template_name, unit, base_goods_models_id, base_goods_models_name, init_counts, inventory_counts, error_counts, inventory_result from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, wh_form_inventory_id, base_goods_template_id, goods_template_name, unit, base_goods_models_id, base_goods_models_name, init_counts, inventory_counts, error_counts, inventory_result from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public WhFormInventoryGoods mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public WhFormInventoryGoods toWhFormInventoryGoods() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* wh_form_inventory_goods RowMapper
|
*
|
* @author genrator
|
*/
|
class WhFormInventoryGoodsRowMapper implements RowMapper<WhFormInventoryGoods> {
|
|
@Override
|
public WhFormInventoryGoods mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
WhFormInventoryGoods wh_form_inventory_goods = new WhFormInventoryGoods();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.Id);
|
if (columnIndex > 0) {
|
wh_form_inventory_goods.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.WhFormInventoryId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_goods.setWhFormInventoryId(null);
|
} else {
|
wh_form_inventory_goods.setWhFormInventoryId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.BaseGoodsTemplateId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_goods.setBaseGoodsTemplateId(null);
|
} else {
|
wh_form_inventory_goods.setBaseGoodsTemplateId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.GoodsTemplateName);
|
if (columnIndex > 0) {
|
wh_form_inventory_goods.setGoodsTemplateName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.Unit);
|
if (columnIndex > 0) {
|
wh_form_inventory_goods.setUnit(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.BaseGoodsModelsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_goods.setBaseGoodsModelsId(null);
|
} else {
|
wh_form_inventory_goods.setBaseGoodsModelsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.BaseGoodsModelsName);
|
if (columnIndex > 0) {
|
wh_form_inventory_goods.setBaseGoodsModelsName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.InitCounts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_goods.setInitCounts(null);
|
} else {
|
wh_form_inventory_goods.setInitCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.InventoryCounts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_goods.setInventoryCounts(null);
|
} else {
|
wh_form_inventory_goods.setInventoryCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.ErrorCounts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_goods.setErrorCounts(null);
|
} else {
|
wh_form_inventory_goods.setErrorCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryGoods_mapper.InventoryResult);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_goods.setInventoryResult(null);
|
} else {
|
wh_form_inventory_goods.setInventoryResult(rs.getInt(columnIndex));
|
}
|
}
|
return wh_form_inventory_goods;
|
}
|
}
|