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 *
|
* @author genrator
|
*/
|
public class WhFormInventory_mapper extends WhFormInventory implements BaseMapper<WhFormInventory> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<WhFormInventory> ROW_MAPPER = new WhFormInventoryRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String BusinessFormCode = "business_form_code";
|
public static final String BusinessFormName = "business_form_name";
|
public static final String WarehouseId = "warehouse_id";
|
public static final String WarehouseName = "warehouse_name";
|
public static final String OperatorId = "operator_id";
|
public static final String OperatorName = "operator_name";
|
public static final String States = "states";
|
public static final String OperatorId2 = "operator_id2";
|
public static final String OperatorName2 = "operator_name2";
|
public static final String IsMoreThanBefore = "is_more_than_before";
|
public static final String IsLessThanBefore = "is_less_than_before";
|
public static final String Beiz1 = "beiz1";
|
public static final String Beiz2 = "beiz2";
|
public static final String AgencyId = "agency_id";
|
public static final String AgencyName = "agency_name";
|
public static final String CreatorId = "creator_id";
|
public static final String CreatorName = "creator_name";
|
public static final String InventoryDate = "inventory_date";
|
public static final String CreateTime = "create_time";
|
public static final String StopTime = "stop_time";
|
|
/**
|
* 默认构造函数
|
*/
|
public WhFormInventory_mapper(WhFormInventory whFormInventory) {
|
if (whFormInventory == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (whFormInventory.isset_id) {
|
this.setId(whFormInventory.getId());
|
}
|
//普通属性
|
if (whFormInventory.isset_businessFormCode) {
|
this.setBusinessFormCode(whFormInventory.getBusinessFormCode());
|
}
|
if (whFormInventory.isset_businessFormName) {
|
this.setBusinessFormName(whFormInventory.getBusinessFormName());
|
}
|
if (whFormInventory.isset_warehouseId) {
|
this.setWarehouseId(whFormInventory.getWarehouseId());
|
}
|
if (whFormInventory.isset_warehouseName) {
|
this.setWarehouseName(whFormInventory.getWarehouseName());
|
}
|
if (whFormInventory.isset_operatorId) {
|
this.setOperatorId(whFormInventory.getOperatorId());
|
}
|
if (whFormInventory.isset_operatorName) {
|
this.setOperatorName(whFormInventory.getOperatorName());
|
}
|
if (whFormInventory.isset_states) {
|
this.setStates(whFormInventory.getStates());
|
}
|
if (whFormInventory.isset_operatorId2) {
|
this.setOperatorId2(whFormInventory.getOperatorId2());
|
}
|
if (whFormInventory.isset_operatorName2) {
|
this.setOperatorName2(whFormInventory.getOperatorName2());
|
}
|
if (whFormInventory.isset_isMoreThanBefore) {
|
this.setIsMoreThanBefore(whFormInventory.getIsMoreThanBefore());
|
}
|
if (whFormInventory.isset_isLessThanBefore) {
|
this.setIsLessThanBefore(whFormInventory.getIsLessThanBefore());
|
}
|
if (whFormInventory.isset_beiz1) {
|
this.setBeiz1(whFormInventory.getBeiz1());
|
}
|
if (whFormInventory.isset_beiz2) {
|
this.setBeiz2(whFormInventory.getBeiz2());
|
}
|
if (whFormInventory.isset_agencyId) {
|
this.setAgencyId(whFormInventory.getAgencyId());
|
}
|
if (whFormInventory.isset_agencyName) {
|
this.setAgencyName(whFormInventory.getAgencyName());
|
}
|
if (whFormInventory.isset_creatorId) {
|
this.setCreatorId(whFormInventory.getCreatorId());
|
}
|
if (whFormInventory.isset_creatorName) {
|
this.setCreatorName(whFormInventory.getCreatorName());
|
}
|
if (whFormInventory.isset_inventoryDate) {
|
this.setInventoryDate(whFormInventory.getInventoryDate());
|
}
|
if (whFormInventory.isset_createTime) {
|
this.setCreateTime(whFormInventory.getCreateTime());
|
}
|
if (whFormInventory.isset_stopTime) {
|
this.setStopTime(whFormInventory.getStopTime());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(wh_form_inventory.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "wh_form_inventory";
|
/**
|
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(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ib.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName);
|
ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ib.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ib.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ib.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ib.set(States, this.getStates(), this.isset_states);
|
ib.set(OperatorId2, this.getOperatorId2(), this.isset_operatorId2);
|
ib.set(OperatorName2, this.getOperatorName2(), this.isset_operatorName2);
|
ib.set(IsMoreThanBefore, this.getIsMoreThanBefore(), this.isset_isMoreThanBefore);
|
ib.set(IsLessThanBefore, this.getIsLessThanBefore(), this.isset_isLessThanBefore);
|
ib.set(Beiz1, this.getBeiz1(), this.isset_beiz1);
|
ib.set(Beiz2, this.getBeiz2(), this.isset_beiz2);
|
ib.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ib.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ib.set(CreatorId, this.getCreatorId(), this.isset_creatorId);
|
ib.set(CreatorName, this.getCreatorName(), this.isset_creatorName);
|
ib.set(InventoryDate, this.getInventoryDate(), this.isset_inventoryDate);
|
ib.set(CreateTime, this.getCreateTime(), this.isset_createTime);
|
ib.set(StopTime, this.getStopTime(), this.isset_stopTime);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(States, this.getStates(), this.isset_states);
|
ub.set(OperatorId2, this.getOperatorId2(), this.isset_operatorId2);
|
ub.set(OperatorName2, this.getOperatorName2(), this.isset_operatorName2);
|
ub.set(IsMoreThanBefore, this.getIsMoreThanBefore(), this.isset_isMoreThanBefore);
|
ub.set(IsLessThanBefore, this.getIsLessThanBefore(), this.isset_isLessThanBefore);
|
ub.set(Beiz1, this.getBeiz1(), this.isset_beiz1);
|
ub.set(Beiz2, this.getBeiz2(), this.isset_beiz2);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(CreatorId, this.getCreatorId(), this.isset_creatorId);
|
ub.set(CreatorName, this.getCreatorName(), this.isset_creatorName);
|
ub.set(InventoryDate, this.getInventoryDate(), this.isset_inventoryDate);
|
ub.set(CreateTime, this.getCreateTime(), this.isset_createTime);
|
ub.set(StopTime, this.getStopTime(), this.isset_stopTime);
|
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(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(States, this.getStates(), this.isset_states);
|
ub.set(OperatorId2, this.getOperatorId2(), this.isset_operatorId2);
|
ub.set(OperatorName2, this.getOperatorName2(), this.isset_operatorName2);
|
ub.set(IsMoreThanBefore, this.getIsMoreThanBefore(), this.isset_isMoreThanBefore);
|
ub.set(IsLessThanBefore, this.getIsLessThanBefore(), this.isset_isLessThanBefore);
|
ub.set(Beiz1, this.getBeiz1(), this.isset_beiz1);
|
ub.set(Beiz2, this.getBeiz2(), this.isset_beiz2);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(CreatorId, this.getCreatorId(), this.isset_creatorId);
|
ub.set(CreatorName, this.getCreatorName(), this.isset_creatorName);
|
ub.set(InventoryDate, this.getInventoryDate(), this.isset_inventoryDate);
|
ub.set(CreateTime, this.getCreateTime(), this.isset_createTime);
|
ub.set(StopTime, this.getStopTime(), this.isset_stopTime);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(States, this.getStates(), this.isset_states);
|
ub.set(OperatorId2, this.getOperatorId2(), this.isset_operatorId2);
|
ub.set(OperatorName2, this.getOperatorName2(), this.isset_operatorName2);
|
ub.set(IsMoreThanBefore, this.getIsMoreThanBefore(), this.isset_isMoreThanBefore);
|
ub.set(IsLessThanBefore, this.getIsLessThanBefore(), this.isset_isLessThanBefore);
|
ub.set(Beiz1, this.getBeiz1(), this.isset_beiz1);
|
ub.set(Beiz2, this.getBeiz2(), this.isset_beiz2);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(CreatorId, this.getCreatorId(), this.isset_creatorId);
|
ub.set(CreatorName, this.getCreatorName(), this.isset_creatorName);
|
ub.set(InventoryDate, this.getInventoryDate(), this.isset_inventoryDate);
|
ub.set(CreateTime, this.getCreateTime(), this.isset_createTime);
|
ub.set(StopTime, this.getStopTime(), this.isset_stopTime);
|
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, business_form_code, business_form_name, warehouse_id, warehouse_name, operator_id, operator_name, states, operator_id2, operator_name2, is_more_than_before, is_less_than_before, beiz1, beiz2, agency_id, agency_name, creator_id, creator_name, inventory_date, create_time, stop_time from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, business_form_code, business_form_name, warehouse_id, warehouse_name, operator_id, operator_name, states, operator_id2, operator_name2, is_more_than_before, is_less_than_before, beiz1, beiz2, agency_id, agency_name, creator_id, creator_name, inventory_date, create_time, stop_time from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public WhFormInventory mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public WhFormInventory toWhFormInventory() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* wh_form_inventory RowMapper
|
*
|
* @author genrator
|
*/
|
class WhFormInventoryRowMapper implements RowMapper<WhFormInventory> {
|
|
@Override
|
public WhFormInventory mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
WhFormInventory wh_form_inventory = new WhFormInventory();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.Id);
|
if (columnIndex > 0) {
|
wh_form_inventory.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.BusinessFormCode);
|
if (columnIndex > 0) {
|
wh_form_inventory.setBusinessFormCode(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.BusinessFormName);
|
if (columnIndex > 0) {
|
wh_form_inventory.setBusinessFormName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.WarehouseId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setWarehouseId(null);
|
} else {
|
wh_form_inventory.setWarehouseId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.WarehouseName);
|
if (columnIndex > 0) {
|
wh_form_inventory.setWarehouseName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.OperatorId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setOperatorId(null);
|
} else {
|
wh_form_inventory.setOperatorId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.OperatorName);
|
if (columnIndex > 0) {
|
wh_form_inventory.setOperatorName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.States);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setStates(null);
|
} else {
|
wh_form_inventory.setStates(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.OperatorId2);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setOperatorId2(null);
|
} else {
|
wh_form_inventory.setOperatorId2(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.OperatorName2);
|
if (columnIndex > 0) {
|
wh_form_inventory.setOperatorName2(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.IsMoreThanBefore);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setIsMoreThanBefore(null);
|
} else {
|
wh_form_inventory.setIsMoreThanBefore(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.IsLessThanBefore);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setIsLessThanBefore(null);
|
} else {
|
wh_form_inventory.setIsLessThanBefore(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.Beiz1);
|
if (columnIndex > 0) {
|
wh_form_inventory.setBeiz1(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.Beiz2);
|
if (columnIndex > 0) {
|
wh_form_inventory.setBeiz2(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.AgencyId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setAgencyId(null);
|
} else {
|
wh_form_inventory.setAgencyId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.AgencyName);
|
if (columnIndex > 0) {
|
wh_form_inventory.setAgencyName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.CreatorId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setCreatorId(null);
|
} else {
|
wh_form_inventory.setCreatorId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.CreatorName);
|
if (columnIndex > 0) {
|
wh_form_inventory.setCreatorName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.InventoryDate);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setInventoryDate(null);
|
} else {
|
wh_form_inventory.setInventoryDate(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.CreateTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setCreateTime(null);
|
} else {
|
wh_form_inventory.setCreateTime(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormInventory_mapper.StopTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_inventory.setStopTime(null);
|
} else {
|
wh_form_inventory.setStopTime(rs.getLong(columnIndex));
|
}
|
}
|
return wh_form_inventory;
|
}
|
}
|