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_GOODS_WH_RECORD *
|
* @author genrator
|
*/
|
public class LGoodsWhRecord_mapper extends LGoodsWhRecord implements BaseMapper<LGoodsWhRecord> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<LGoodsWhRecord> ROW_MAPPER = new LGoodsWhRecordRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String LWarehouseFlowId = "l_warehouse_flow_id";
|
public static final String LWhGoodsId = "l_wh_goods_id";
|
public static final String WarehouseId = "warehouse_id";
|
public static final String ParentId = "parent_id";
|
public static final String DealTime = "deal_time";
|
|
/**
|
* 默认构造函数
|
*/
|
public LGoodsWhRecord_mapper(LGoodsWhRecord lGoodsWhRecord) {
|
if (lGoodsWhRecord == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (lGoodsWhRecord.isset_id) {
|
this.setId(lGoodsWhRecord.getId());
|
}
|
//普通属性
|
if (lGoodsWhRecord.isset_lWarehouseFlowId) {
|
this.setLWarehouseFlowId(lGoodsWhRecord.getLWarehouseFlowId());
|
}
|
if (lGoodsWhRecord.isset_lWhGoodsId) {
|
this.setLWhGoodsId(lGoodsWhRecord.getLWhGoodsId());
|
}
|
if (lGoodsWhRecord.isset_warehouseId) {
|
this.setWarehouseId(lGoodsWhRecord.getWarehouseId());
|
}
|
if (lGoodsWhRecord.isset_parentId) {
|
this.setParentId(lGoodsWhRecord.getParentId());
|
}
|
if (lGoodsWhRecord.isset_dealTime) {
|
this.setDealTime(lGoodsWhRecord.getDealTime());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(l_goods_wh_record.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "l_goods_wh_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(LWhGoodsId, this.getLWhGoodsId(), this.isset_lWhGoodsId);
|
ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ib.set(ParentId, this.getParentId(), this.isset_parentId);
|
ib.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
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(LWhGoodsId, this.getLWhGoodsId(), this.isset_lWhGoodsId);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(ParentId, this.getParentId(), this.isset_parentId);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
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(LWhGoodsId, this.getLWhGoodsId(), this.isset_lWhGoodsId);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(ParentId, this.getParentId(), this.isset_parentId);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
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(LWhGoodsId, this.getLWhGoodsId(), this.isset_lWhGoodsId);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(ParentId, this.getParentId(), this.isset_parentId);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
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, l_wh_goods_id, warehouse_id, parent_id, deal_time from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, l_warehouse_flow_id, l_wh_goods_id, warehouse_id, parent_id, deal_time from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public LGoodsWhRecord mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public LGoodsWhRecord toLGoodsWhRecord() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* l_goods_wh_record RowMapper
|
*
|
* @author genrator
|
*/
|
class LGoodsWhRecordRowMapper implements RowMapper<LGoodsWhRecord> {
|
|
@Override
|
public LGoodsWhRecord mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
LGoodsWhRecord l_goods_wh_record = new LGoodsWhRecord();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, LGoodsWhRecord_mapper.Id);
|
if (columnIndex > 0) {
|
l_goods_wh_record.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, LGoodsWhRecord_mapper.LWarehouseFlowId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_goods_wh_record.setLWarehouseFlowId(null);
|
} else {
|
l_goods_wh_record.setLWarehouseFlowId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LGoodsWhRecord_mapper.LWhGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_goods_wh_record.setLWhGoodsId(null);
|
} else {
|
l_goods_wh_record.setLWhGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LGoodsWhRecord_mapper.WarehouseId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_goods_wh_record.setWarehouseId(null);
|
} else {
|
l_goods_wh_record.setWarehouseId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LGoodsWhRecord_mapper.ParentId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_goods_wh_record.setParentId(null);
|
} else {
|
l_goods_wh_record.setParentId(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LGoodsWhRecord_mapper.DealTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_goods_wh_record.setDealTime(null);
|
} else {
|
l_goods_wh_record.setDealTime(rs.getLong(columnIndex));
|
}
|
}
|
return l_goods_wh_record;
|
}
|
}
|