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_WAREHOUSE_FLOW *
|
* @author genrator
|
*/
|
public class LWarehouseFlow_mapper extends LWarehouseFlow implements BaseMapper<LWarehouseFlow> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<LWarehouseFlow> ROW_MAPPER = new LWarehouseFlowRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String WarehouseType = "warehouse_type";
|
public static final String WarehouseId = "warehouse_id";
|
public static final String WarehouseName = "warehouse_name";
|
public static final String ThisType = "this_type";
|
public static final String BusinessType = "business_type";
|
public static final String BusinessFormId = "business_form_id";
|
public static final String OperatorId = "operator_id";
|
public static final String OperatorName = "operator_name";
|
public static final String DealTime = "deal_time";
|
|
/**
|
* 默认构造函数
|
*/
|
public LWarehouseFlow_mapper(LWarehouseFlow lWarehouseFlow) {
|
if (lWarehouseFlow == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (lWarehouseFlow.isset_id) {
|
this.setId(lWarehouseFlow.getId());
|
}
|
//普通属性
|
if (lWarehouseFlow.isset_warehouseType) {
|
this.setWarehouseType(lWarehouseFlow.getWarehouseType());
|
}
|
if (lWarehouseFlow.isset_warehouseId) {
|
this.setWarehouseId(lWarehouseFlow.getWarehouseId());
|
}
|
if (lWarehouseFlow.isset_warehouseName) {
|
this.setWarehouseName(lWarehouseFlow.getWarehouseName());
|
}
|
if (lWarehouseFlow.isset_thisType) {
|
this.setThisType(lWarehouseFlow.getThisType());
|
}
|
if (lWarehouseFlow.isset_businessType) {
|
this.setBusinessType(lWarehouseFlow.getBusinessType());
|
}
|
if (lWarehouseFlow.isset_businessFormId) {
|
this.setBusinessFormId(lWarehouseFlow.getBusinessFormId());
|
}
|
if (lWarehouseFlow.isset_operatorId) {
|
this.setOperatorId(lWarehouseFlow.getOperatorId());
|
}
|
if (lWarehouseFlow.isset_operatorName) {
|
this.setOperatorName(lWarehouseFlow.getOperatorName());
|
}
|
if (lWarehouseFlow.isset_dealTime) {
|
this.setDealTime(lWarehouseFlow.getDealTime());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(l_warehouse_flow.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "l_warehouse_flow";
|
/**
|
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(WarehouseType, this.getWarehouseType(), this.isset_warehouseType);
|
ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ib.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ib.set(ThisType, this.getThisType(), this.isset_thisType);
|
ib.set(BusinessType, this.getBusinessType(), this.isset_businessType);
|
ib.set(BusinessFormId, this.getBusinessFormId(), this.isset_businessFormId);
|
ib.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ib.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
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(WarehouseType, this.getWarehouseType(), this.isset_warehouseType);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(ThisType, this.getThisType(), this.isset_thisType);
|
ub.set(BusinessType, this.getBusinessType(), this.isset_businessType);
|
ub.set(BusinessFormId, this.getBusinessFormId(), this.isset_businessFormId);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
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(WarehouseType, this.getWarehouseType(), this.isset_warehouseType);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(ThisType, this.getThisType(), this.isset_thisType);
|
ub.set(BusinessType, this.getBusinessType(), this.isset_businessType);
|
ub.set(BusinessFormId, this.getBusinessFormId(), this.isset_businessFormId);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
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(WarehouseType, this.getWarehouseType(), this.isset_warehouseType);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(ThisType, this.getThisType(), this.isset_thisType);
|
ub.set(BusinessType, this.getBusinessType(), this.isset_businessType);
|
ub.set(BusinessFormId, this.getBusinessFormId(), this.isset_businessFormId);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
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, warehouse_type, warehouse_id, warehouse_name, this_type, business_type, business_form_id, operator_id, operator_name, deal_time from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, warehouse_type, warehouse_id, warehouse_name, this_type, business_type, business_form_id, operator_id, operator_name, deal_time from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public LWarehouseFlow mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public LWarehouseFlow toLWarehouseFlow() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* l_warehouse_flow RowMapper
|
*
|
* @author genrator
|
*/
|
class LWarehouseFlowRowMapper implements RowMapper<LWarehouseFlow> {
|
|
@Override
|
public LWarehouseFlow mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
LWarehouseFlow l_warehouse_flow = new LWarehouseFlow();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.Id);
|
if (columnIndex > 0) {
|
l_warehouse_flow.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.WarehouseType);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_warehouse_flow.setWarehouseType(null);
|
} else {
|
l_warehouse_flow.setWarehouseType(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.WarehouseId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_warehouse_flow.setWarehouseId(null);
|
} else {
|
l_warehouse_flow.setWarehouseId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.WarehouseName);
|
if (columnIndex > 0) {
|
l_warehouse_flow.setWarehouseName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.ThisType);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_warehouse_flow.setThisType(null);
|
} else {
|
l_warehouse_flow.setThisType(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.BusinessType);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_warehouse_flow.setBusinessType(null);
|
} else {
|
l_warehouse_flow.setBusinessType(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.BusinessFormId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_warehouse_flow.setBusinessFormId(null);
|
} else {
|
l_warehouse_flow.setBusinessFormId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.OperatorId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_warehouse_flow.setOperatorId(null);
|
} else {
|
l_warehouse_flow.setOperatorId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.OperatorName);
|
if (columnIndex > 0) {
|
l_warehouse_flow.setOperatorName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWarehouseFlow_mapper.DealTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_warehouse_flow.setDealTime(null);
|
} else {
|
l_warehouse_flow.setDealTime(rs.getLong(columnIndex));
|
}
|
}
|
return l_warehouse_flow;
|
}
|
}
|