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_GOODS_RECORD *
|
* @author genrator
|
*/
|
public class LWhGoodsRecord_mapper extends LWhGoodsRecord implements BaseMapper<LWhGoodsRecord> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<LWhGoodsRecord> ROW_MAPPER = new LWhGoodsRecordRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String LWarehouseFlowId = "l_warehouse_flow_id";
|
public static final String WarehouseFlowId = "warehouse_flow_id";
|
public static final String InitialCount = "initial_count";
|
public static final String ThisType = "this_type";
|
public static final String ThisCount = "this_count";
|
public static final String EndCount = "end_count";
|
public static final String BaseGoodsTemplateId = "base_goods_template_id";
|
public static final String GoodsTemplateName = "goods_template_name";
|
public static final String BaseGoodsModelsId = "base_goods_models_id";
|
public static final String BaseGoodsModelsName = "base_goods_models_name";
|
|
/**
|
* 默认构造函数
|
*/
|
public LWhGoodsRecord_mapper(LWhGoodsRecord lWhGoodsRecord) {
|
if (lWhGoodsRecord == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (lWhGoodsRecord.isset_id) {
|
this.setId(lWhGoodsRecord.getId());
|
}
|
//普通属性
|
if (lWhGoodsRecord.isset_lWarehouseFlowId) {
|
this.setLWarehouseFlowId(lWhGoodsRecord.getLWarehouseFlowId());
|
}
|
if (lWhGoodsRecord.isset_warehouseFlowId) {
|
this.setWarehouseFlowId(lWhGoodsRecord.getWarehouseFlowId());
|
}
|
if (lWhGoodsRecord.isset_initialCount) {
|
this.setInitialCount(lWhGoodsRecord.getInitialCount());
|
}
|
if (lWhGoodsRecord.isset_thisType) {
|
this.setThisType(lWhGoodsRecord.getThisType());
|
}
|
if (lWhGoodsRecord.isset_thisCount) {
|
this.setThisCount(lWhGoodsRecord.getThisCount());
|
}
|
if (lWhGoodsRecord.isset_endCount) {
|
this.setEndCount(lWhGoodsRecord.getEndCount());
|
}
|
if (lWhGoodsRecord.isset_baseGoodsTemplateId) {
|
this.setBaseGoodsTemplateId(lWhGoodsRecord.getBaseGoodsTemplateId());
|
}
|
if (lWhGoodsRecord.isset_goodsTemplateName) {
|
this.setGoodsTemplateName(lWhGoodsRecord.getGoodsTemplateName());
|
}
|
if (lWhGoodsRecord.isset_baseGoodsModelsId) {
|
this.setBaseGoodsModelsId(lWhGoodsRecord.getBaseGoodsModelsId());
|
}
|
if (lWhGoodsRecord.isset_baseGoodsModelsName) {
|
this.setBaseGoodsModelsName(lWhGoodsRecord.getBaseGoodsModelsName());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(l_wh_goods_record.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "l_wh_goods_record";
|
/**
|
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(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId);
|
ib.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId);
|
ib.set(InitialCount, this.getInitialCount(), this.isset_initialCount);
|
ib.set(ThisType, this.getThisType(), this.isset_thisType);
|
ib.set(ThisCount, this.getThisCount(), this.isset_thisCount);
|
ib.set(EndCount, this.getEndCount(), this.isset_endCount);
|
ib.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ib.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ib.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ib.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId);
|
ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId);
|
ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount);
|
ub.set(ThisType, this.getThisType(), this.isset_thisType);
|
ub.set(ThisCount, this.getThisCount(), this.isset_thisCount);
|
ub.set(EndCount, this.getEndCount(), this.isset_endCount);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
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(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId);
|
ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId);
|
ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount);
|
ub.set(ThisType, this.getThisType(), this.isset_thisType);
|
ub.set(ThisCount, this.getThisCount(), this.isset_thisCount);
|
ub.set(EndCount, this.getEndCount(), this.isset_endCount);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId);
|
ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId);
|
ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount);
|
ub.set(ThisType, this.getThisType(), this.isset_thisType);
|
ub.set(ThisCount, this.getThisCount(), this.isset_thisCount);
|
ub.set(EndCount, this.getEndCount(), this.isset_endCount);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
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, l_warehouse_flow_id, warehouse_flow_id, initial_count, this_type, this_count, end_count, base_goods_template_id, goods_template_name, base_goods_models_id, base_goods_models_name from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, l_warehouse_flow_id, warehouse_flow_id, initial_count, this_type, this_count, end_count, base_goods_template_id, goods_template_name, base_goods_models_id, base_goods_models_name from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public LWhGoodsRecord mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public LWhGoodsRecord toLWhGoodsRecord() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* l_wh_goods_record RowMapper
|
*
|
* @author genrator
|
*/
|
class LWhGoodsRecordRowMapper implements RowMapper<LWhGoodsRecord> {
|
|
@Override
|
public LWhGoodsRecord mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
LWhGoodsRecord l_wh_goods_record = new LWhGoodsRecord();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.Id);
|
if (columnIndex > 0) {
|
l_wh_goods_record.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.LWarehouseFlowId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_goods_record.setLWarehouseFlowId(null);
|
} else {
|
l_wh_goods_record.setLWarehouseFlowId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.WarehouseFlowId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_goods_record.setWarehouseFlowId(null);
|
} else {
|
l_wh_goods_record.setWarehouseFlowId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.InitialCount);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_goods_record.setInitialCount(null);
|
} else {
|
l_wh_goods_record.setInitialCount(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.ThisType);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_goods_record.setThisType(null);
|
} else {
|
l_wh_goods_record.setThisType(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.ThisCount);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_goods_record.setThisCount(null);
|
} else {
|
l_wh_goods_record.setThisCount(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.EndCount);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_goods_record.setEndCount(null);
|
} else {
|
l_wh_goods_record.setEndCount(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.BaseGoodsTemplateId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_goods_record.setBaseGoodsTemplateId(null);
|
} else {
|
l_wh_goods_record.setBaseGoodsTemplateId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.GoodsTemplateName);
|
if (columnIndex > 0) {
|
l_wh_goods_record.setGoodsTemplateName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.BaseGoodsModelsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_goods_record.setBaseGoodsModelsId(null);
|
} else {
|
l_wh_goods_record.setBaseGoodsModelsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.BaseGoodsModelsName);
|
if (columnIndex > 0) {
|
l_wh_goods_record.setBaseGoodsModelsName(rs.getString(columnIndex));
|
}
|
return l_wh_goods_record;
|
}
|
}
|