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_INVENTORY_GOODS *
|
* @author genrator
|
*/
|
public class LWhFormInventoryGoods_mapper extends LWhFormInventoryGoods implements BaseMapper<LWhFormInventoryGoods> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<LWhFormInventoryGoods> ROW_MAPPER = new LWhFormInventoryGoodsRowMapper();
|
|
// 主键
|
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 Price = "price";
|
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 LWhFormInventoryGoods_mapper(LWhFormInventoryGoods lWhFormInventoryGoods) {
|
if (lWhFormInventoryGoods == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (lWhFormInventoryGoods.isset_id) {
|
this.setId(lWhFormInventoryGoods.getId());
|
}
|
//普通属性
|
if (lWhFormInventoryGoods.isset_whFormInventoryId) {
|
this.setWhFormInventoryId(lWhFormInventoryGoods.getWhFormInventoryId());
|
}
|
if (lWhFormInventoryGoods.isset_baseGoodsTemplateId) {
|
this.setBaseGoodsTemplateId(lWhFormInventoryGoods.getBaseGoodsTemplateId());
|
}
|
if (lWhFormInventoryGoods.isset_goodsTemplateName) {
|
this.setGoodsTemplateName(lWhFormInventoryGoods.getGoodsTemplateName());
|
}
|
if (lWhFormInventoryGoods.isset_unit) {
|
this.setUnit(lWhFormInventoryGoods.getUnit());
|
}
|
if (lWhFormInventoryGoods.isset_baseGoodsModelsId) {
|
this.setBaseGoodsModelsId(lWhFormInventoryGoods.getBaseGoodsModelsId());
|
}
|
if (lWhFormInventoryGoods.isset_baseGoodsModelsName) {
|
this.setBaseGoodsModelsName(lWhFormInventoryGoods.getBaseGoodsModelsName());
|
}
|
if (lWhFormInventoryGoods.isset_price) {
|
this.setPrice(lWhFormInventoryGoods.getPrice());
|
}
|
if (lWhFormInventoryGoods.isset_initCounts) {
|
this.setInitCounts(lWhFormInventoryGoods.getInitCounts());
|
}
|
if (lWhFormInventoryGoods.isset_inventoryCounts) {
|
this.setInventoryCounts(lWhFormInventoryGoods.getInventoryCounts());
|
}
|
if (lWhFormInventoryGoods.isset_errorCounts) {
|
this.setErrorCounts(lWhFormInventoryGoods.getErrorCounts());
|
}
|
if (lWhFormInventoryGoods.isset_inventoryResult) {
|
this.setInventoryResult(lWhFormInventoryGoods.getInventoryResult());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(l_wh_form_inventory_goods.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "l_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(Price, this.getPrice(), this.isset_price);
|
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(Price, this.getPrice(), this.isset_price);
|
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(Price, this.getPrice(), this.isset_price);
|
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(Price, this.getPrice(), this.isset_price);
|
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, price, 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, price, init_counts, inventory_counts, error_counts, inventory_result from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public LWhFormInventoryGoods mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public LWhFormInventoryGoods toLWhFormInventoryGoods() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* l_wh_form_inventory_goods RowMapper
|
*
|
* @author genrator
|
*/
|
class LWhFormInventoryGoodsRowMapper implements RowMapper<LWhFormInventoryGoods> {
|
|
@Override
|
public LWhFormInventoryGoods mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
LWhFormInventoryGoods l_wh_form_inventory_goods = new LWhFormInventoryGoods();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.Id);
|
if (columnIndex > 0) {
|
l_wh_form_inventory_goods.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.WhFormInventoryId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_inventory_goods.setWhFormInventoryId(null);
|
} else {
|
l_wh_form_inventory_goods.setWhFormInventoryId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.BaseGoodsTemplateId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_inventory_goods.setBaseGoodsTemplateId(null);
|
} else {
|
l_wh_form_inventory_goods.setBaseGoodsTemplateId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.GoodsTemplateName);
|
if (columnIndex > 0) {
|
l_wh_form_inventory_goods.setGoodsTemplateName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.Unit);
|
if (columnIndex > 0) {
|
l_wh_form_inventory_goods.setUnit(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.BaseGoodsModelsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_inventory_goods.setBaseGoodsModelsId(null);
|
} else {
|
l_wh_form_inventory_goods.setBaseGoodsModelsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.BaseGoodsModelsName);
|
if (columnIndex > 0) {
|
l_wh_form_inventory_goods.setBaseGoodsModelsName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.Price);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_inventory_goods.setPrice(null);
|
} else {
|
l_wh_form_inventory_goods.setPrice(rs.getDouble(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.InitCounts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_inventory_goods.setInitCounts(null);
|
} else {
|
l_wh_form_inventory_goods.setInitCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.InventoryCounts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_inventory_goods.setInventoryCounts(null);
|
} else {
|
l_wh_form_inventory_goods.setInventoryCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.ErrorCounts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_inventory_goods.setErrorCounts(null);
|
} else {
|
l_wh_form_inventory_goods.setErrorCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormInventoryGoods_mapper.InventoryResult);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_inventory_goods.setInventoryResult(null);
|
} else {
|
l_wh_form_inventory_goods.setInventoryResult(rs.getInt(columnIndex));
|
}
|
}
|
return l_wh_form_inventory_goods;
|
}
|
}
|