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_TRANSFER_MODEL *
|
* @author genrator
|
*/
|
public class WhFormTransferModel_mapper extends WhFormTransferModel implements BaseMapper<WhFormTransferModel> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<WhFormTransferModel> ROW_MAPPER = new WhFormTransferModelRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String WhFormTransferId = "wh_form_transfer_id";
|
public static final String WorehouseCount = "worehouse_count";
|
public static final String Counts = "counts";
|
public static final String OutWhGoodsDetailsId = "out_wh_goods_details_id";
|
public static final String InWhGoodsDetailsId = "in_wh_goods_details_id";
|
public static final String WhGoodsId = "wh_goods_id";
|
public static final String WhFormTransferGoodsId = "wh_form_transfer_goods_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public WhFormTransferModel_mapper(WhFormTransferModel whFormTransferModel) {
|
if (whFormTransferModel == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (whFormTransferModel.isset_id) {
|
this.setId(whFormTransferModel.getId());
|
}
|
//普通属性
|
if (whFormTransferModel.isset_whFormTransferId) {
|
this.setWhFormTransferId(whFormTransferModel.getWhFormTransferId());
|
}
|
if (whFormTransferModel.isset_worehouseCount) {
|
this.setWorehouseCount(whFormTransferModel.getWorehouseCount());
|
}
|
if (whFormTransferModel.isset_counts) {
|
this.setCounts(whFormTransferModel.getCounts());
|
}
|
if (whFormTransferModel.isset_outWhGoodsDetailsId) {
|
this.setOutWhGoodsDetailsId(whFormTransferModel.getOutWhGoodsDetailsId());
|
}
|
if (whFormTransferModel.isset_inWhGoodsDetailsId) {
|
this.setInWhGoodsDetailsId(whFormTransferModel.getInWhGoodsDetailsId());
|
}
|
if (whFormTransferModel.isset_whGoodsId) {
|
this.setWhGoodsId(whFormTransferModel.getWhGoodsId());
|
}
|
if (whFormTransferModel.isset_whFormTransferGoodsId) {
|
this.setWhFormTransferGoodsId(whFormTransferModel.getWhFormTransferGoodsId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(wh_form_transfer_model.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "wh_form_transfer_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(WhFormTransferId, this.getWhFormTransferId(), this.isset_whFormTransferId);
|
ib.set(WorehouseCount, this.getWorehouseCount(), this.isset_worehouseCount);
|
ib.set(Counts, this.getCounts(), this.isset_counts);
|
ib.set(OutWhGoodsDetailsId, this.getOutWhGoodsDetailsId(), this.isset_outWhGoodsDetailsId);
|
ib.set(InWhGoodsDetailsId, this.getInWhGoodsDetailsId(), this.isset_inWhGoodsDetailsId);
|
ib.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ib.set(WhFormTransferGoodsId, this.getWhFormTransferGoodsId(), this.isset_whFormTransferGoodsId);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(WhFormTransferId, this.getWhFormTransferId(), this.isset_whFormTransferId);
|
ub.set(WorehouseCount, this.getWorehouseCount(), this.isset_worehouseCount);
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(OutWhGoodsDetailsId, this.getOutWhGoodsDetailsId(), this.isset_outWhGoodsDetailsId);
|
ub.set(InWhGoodsDetailsId, this.getInWhGoodsDetailsId(), this.isset_inWhGoodsDetailsId);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ub.set(WhFormTransferGoodsId, this.getWhFormTransferGoodsId(), this.isset_whFormTransferGoodsId);
|
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(WhFormTransferId, this.getWhFormTransferId(), this.isset_whFormTransferId);
|
ub.set(WorehouseCount, this.getWorehouseCount(), this.isset_worehouseCount);
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(OutWhGoodsDetailsId, this.getOutWhGoodsDetailsId(), this.isset_outWhGoodsDetailsId);
|
ub.set(InWhGoodsDetailsId, this.getInWhGoodsDetailsId(), this.isset_inWhGoodsDetailsId);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ub.set(WhFormTransferGoodsId, this.getWhFormTransferGoodsId(), this.isset_whFormTransferGoodsId);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(WhFormTransferId, this.getWhFormTransferId(), this.isset_whFormTransferId);
|
ub.set(WorehouseCount, this.getWorehouseCount(), this.isset_worehouseCount);
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(OutWhGoodsDetailsId, this.getOutWhGoodsDetailsId(), this.isset_outWhGoodsDetailsId);
|
ub.set(InWhGoodsDetailsId, this.getInWhGoodsDetailsId(), this.isset_inWhGoodsDetailsId);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ub.set(WhFormTransferGoodsId, this.getWhFormTransferGoodsId(), this.isset_whFormTransferGoodsId);
|
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, wh_form_transfer_id, worehouse_count, counts, out_wh_goods_details_id, in_wh_goods_details_id, wh_goods_id, wh_form_transfer_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, wh_form_transfer_id, worehouse_count, counts, out_wh_goods_details_id, in_wh_goods_details_id, wh_goods_id, wh_form_transfer_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public WhFormTransferModel mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public WhFormTransferModel toWhFormTransferModel() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* wh_form_transfer_model RowMapper
|
*
|
* @author genrator
|
*/
|
class WhFormTransferModelRowMapper implements RowMapper<WhFormTransferModel> {
|
|
@Override
|
public WhFormTransferModel mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
WhFormTransferModel wh_form_transfer_model = new WhFormTransferModel();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, WhFormTransferModel_mapper.Id);
|
if (columnIndex > 0) {
|
wh_form_transfer_model.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, WhFormTransferModel_mapper.WhFormTransferId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_transfer_model.setWhFormTransferId(null);
|
} else {
|
wh_form_transfer_model.setWhFormTransferId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormTransferModel_mapper.WorehouseCount);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_transfer_model.setWorehouseCount(null);
|
} else {
|
wh_form_transfer_model.setWorehouseCount(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormTransferModel_mapper.Counts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_transfer_model.setCounts(null);
|
} else {
|
wh_form_transfer_model.setCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormTransferModel_mapper.OutWhGoodsDetailsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_transfer_model.setOutWhGoodsDetailsId(null);
|
} else {
|
wh_form_transfer_model.setOutWhGoodsDetailsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormTransferModel_mapper.InWhGoodsDetailsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_transfer_model.setInWhGoodsDetailsId(null);
|
} else {
|
wh_form_transfer_model.setInWhGoodsDetailsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormTransferModel_mapper.WhGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_transfer_model.setWhGoodsId(null);
|
} else {
|
wh_form_transfer_model.setWhGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormTransferModel_mapper.WhFormTransferGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_transfer_model.setWhFormTransferGoodsId(null);
|
} else {
|
wh_form_transfer_model.setWhFormTransferGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
return wh_form_transfer_model;
|
}
|
}
|