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_MODEL *
|
* @author genrator
|
*/
|
public class WhFormInventoryModel_mapper extends WhFormInventoryModel implements BaseMapper<WhFormInventoryModel> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<WhFormInventoryModel> ROW_MAPPER = new WhFormInventoryModelRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String Counts = "counts";
|
public static final String WhFormInventoryId = "wh_form_inventory_id";
|
public static final String InventoryResult = "inventory_result";
|
public static final String WhGoodsDetailsId = "wh_goods_details_id";
|
public static final String Beiz = "beiz";
|
public static final String WhFormInventoryGoodsId = "wh_form_inventory_goods_id";
|
public static final String WhGoodsId = "wh_goods_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public WhFormInventoryModel_mapper(WhFormInventoryModel whFormInventoryModel) {
|
if (whFormInventoryModel == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (whFormInventoryModel.isset_id) {
|
this.setId(whFormInventoryModel.getId());
|
}
|
//普通属性
|
if (whFormInventoryModel.isset_counts) {
|
this.setCounts(whFormInventoryModel.getCounts());
|
}
|
if (whFormInventoryModel.isset_whFormInventoryId) {
|
this.setWhFormInventoryId(whFormInventoryModel.getWhFormInventoryId());
|
}
|
if (whFormInventoryModel.isset_inventoryResult) {
|
this.setInventoryResult(whFormInventoryModel.getInventoryResult());
|
}
|
if (whFormInventoryModel.isset_whGoodsDetailsId) {
|
this.setWhGoodsDetailsId(whFormInventoryModel.getWhGoodsDetailsId());
|
}
|
if (whFormInventoryModel.isset_beiz) {
|
this.setBeiz(whFormInventoryModel.getBeiz());
|
}
|
if (whFormInventoryModel.isset_whFormInventoryGoodsId) {
|
this.setWhFormInventoryGoodsId(whFormInventoryModel.getWhFormInventoryGoodsId());
|
}
|
if (whFormInventoryModel.isset_whGoodsId) {
|
this.setWhGoodsId(whFormInventoryModel.getWhGoodsId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(wh_form_inventory_model.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "wh_form_inventory_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(Counts, this.getCounts(), this.isset_counts);
|
ib.set(WhFormInventoryId, this.getWhFormInventoryId(), this.isset_whFormInventoryId);
|
ib.set(InventoryResult, this.getInventoryResult(), this.isset_inventoryResult);
|
ib.set(WhGoodsDetailsId, this.getWhGoodsDetailsId(), this.isset_whGoodsDetailsId);
|
ib.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ib.set(WhFormInventoryGoodsId, this.getWhFormInventoryGoodsId(), this.isset_whFormInventoryGoodsId);
|
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(Counts, this.getCounts(), this.isset_counts);
|
ub.set(WhFormInventoryId, this.getWhFormInventoryId(), this.isset_whFormInventoryId);
|
ub.set(InventoryResult, this.getInventoryResult(), this.isset_inventoryResult);
|
ub.set(WhGoodsDetailsId, this.getWhGoodsDetailsId(), this.isset_whGoodsDetailsId);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(WhFormInventoryGoodsId, this.getWhFormInventoryGoodsId(), this.isset_whFormInventoryGoodsId);
|
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(Counts, this.getCounts(), this.isset_counts);
|
ub.set(WhFormInventoryId, this.getWhFormInventoryId(), this.isset_whFormInventoryId);
|
ub.set(InventoryResult, this.getInventoryResult(), this.isset_inventoryResult);
|
ub.set(WhGoodsDetailsId, this.getWhGoodsDetailsId(), this.isset_whGoodsDetailsId);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(WhFormInventoryGoodsId, this.getWhFormInventoryGoodsId(), this.isset_whFormInventoryGoodsId);
|
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(Counts, this.getCounts(), this.isset_counts);
|
ub.set(WhFormInventoryId, this.getWhFormInventoryId(), this.isset_whFormInventoryId);
|
ub.set(InventoryResult, this.getInventoryResult(), this.isset_inventoryResult);
|
ub.set(WhGoodsDetailsId, this.getWhGoodsDetailsId(), this.isset_whGoodsDetailsId);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(WhFormInventoryGoodsId, this.getWhFormInventoryGoodsId(), this.isset_whFormInventoryGoodsId);
|
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, counts, wh_form_inventory_id, inventory_result, wh_goods_details_id, beiz, wh_form_inventory_goods_id, wh_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, counts, wh_form_inventory_id, inventory_result, wh_goods_details_id, beiz, wh_form_inventory_goods_id, wh_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public WhFormInventoryModel mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public WhFormInventoryModel toWhFormInventoryModel() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* wh_form_inventory_model RowMapper
|
*
|
* @author genrator
|
*/
|
class WhFormInventoryModelRowMapper implements RowMapper<WhFormInventoryModel> {
|
|
@Override
|
public WhFormInventoryModel mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
WhFormInventoryModel wh_form_inventory_model = new WhFormInventoryModel();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryModel_mapper.Id);
|
if (columnIndex > 0) {
|
wh_form_inventory_model.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryModel_mapper.Counts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_model.setCounts(null);
|
} else {
|
wh_form_inventory_model.setCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryModel_mapper.WhFormInventoryId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_model.setWhFormInventoryId(null);
|
} else {
|
wh_form_inventory_model.setWhFormInventoryId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryModel_mapper.InventoryResult);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_model.setInventoryResult(null);
|
} else {
|
wh_form_inventory_model.setInventoryResult(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryModel_mapper.WhGoodsDetailsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_model.setWhGoodsDetailsId(null);
|
} else {
|
wh_form_inventory_model.setWhGoodsDetailsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryModel_mapper.Beiz);
|
if (columnIndex > 0) {
|
wh_form_inventory_model.setBeiz(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryModel_mapper.WhFormInventoryGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_model.setWhFormInventoryGoodsId(null);
|
} else {
|
wh_form_inventory_model.setWhFormInventoryGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventoryModel_mapper.WhGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory_model.setWhGoodsId(null);
|
} else {
|
wh_form_inventory_model.setWhGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
return wh_form_inventory_model;
|
}
|
}
|