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_OUTPUT_MODEL *
|
* @author genrator
|
*/
|
public class WhFormOutputModel_mapper extends WhFormOutputModel implements BaseMapper<WhFormOutputModel> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<WhFormOutputModel> ROW_MAPPER = new WhFormOutputModelRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String Counts = "counts";
|
public static final String OutWhGoodsDetailsId = "out_wh_goods_details_id";
|
public static final String WhGoodsId = "wh_goods_id";
|
public static final String WhFormOutputId = "wh_form_output_id";
|
public static final String WhFormOutputGoodsId = "wh_form_output_goods_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public WhFormOutputModel_mapper(WhFormOutputModel whFormOutputModel) {
|
if (whFormOutputModel == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (whFormOutputModel.isset_id) {
|
this.setId(whFormOutputModel.getId());
|
}
|
//普通属性
|
if (whFormOutputModel.isset_counts) {
|
this.setCounts(whFormOutputModel.getCounts());
|
}
|
if (whFormOutputModel.isset_outWhGoodsDetailsId) {
|
this.setOutWhGoodsDetailsId(whFormOutputModel.getOutWhGoodsDetailsId());
|
}
|
if (whFormOutputModel.isset_whGoodsId) {
|
this.setWhGoodsId(whFormOutputModel.getWhGoodsId());
|
}
|
if (whFormOutputModel.isset_whFormOutputId) {
|
this.setWhFormOutputId(whFormOutputModel.getWhFormOutputId());
|
}
|
if (whFormOutputModel.isset_whFormOutputGoodsId) {
|
this.setWhFormOutputGoodsId(whFormOutputModel.getWhFormOutputGoodsId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(wh_form_output_model.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "wh_form_output_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(Counts, this.getCounts(), this.isset_counts);
|
ib.set(OutWhGoodsDetailsId, this.getOutWhGoodsDetailsId(), this.isset_outWhGoodsDetailsId);
|
ib.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ib.set(WhFormOutputId, this.getWhFormOutputId(), this.isset_whFormOutputId);
|
ib.set(WhFormOutputGoodsId, this.getWhFormOutputGoodsId(), this.isset_whFormOutputGoodsId);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(OutWhGoodsDetailsId, this.getOutWhGoodsDetailsId(), this.isset_outWhGoodsDetailsId);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ub.set(WhFormOutputId, this.getWhFormOutputId(), this.isset_whFormOutputId);
|
ub.set(WhFormOutputGoodsId, this.getWhFormOutputGoodsId(), this.isset_whFormOutputGoodsId);
|
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(Counts, this.getCounts(), this.isset_counts);
|
ub.set(OutWhGoodsDetailsId, this.getOutWhGoodsDetailsId(), this.isset_outWhGoodsDetailsId);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ub.set(WhFormOutputId, this.getWhFormOutputId(), this.isset_whFormOutputId);
|
ub.set(WhFormOutputGoodsId, this.getWhFormOutputGoodsId(), this.isset_whFormOutputGoodsId);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(OutWhGoodsDetailsId, this.getOutWhGoodsDetailsId(), this.isset_outWhGoodsDetailsId);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ub.set(WhFormOutputId, this.getWhFormOutputId(), this.isset_whFormOutputId);
|
ub.set(WhFormOutputGoodsId, this.getWhFormOutputGoodsId(), this.isset_whFormOutputGoodsId);
|
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, counts, out_wh_goods_details_id, wh_goods_id, wh_form_output_id, wh_form_output_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, counts, out_wh_goods_details_id, wh_goods_id, wh_form_output_id, wh_form_output_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public WhFormOutputModel mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public WhFormOutputModel toWhFormOutputModel() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* wh_form_output_model RowMapper
|
*
|
* @author genrator
|
*/
|
class WhFormOutputModelRowMapper implements RowMapper<WhFormOutputModel> {
|
|
@Override
|
public WhFormOutputModel mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
WhFormOutputModel wh_form_output_model = new WhFormOutputModel();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, WhFormOutputModel_mapper.Id);
|
if (columnIndex > 0) {
|
wh_form_output_model.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, WhFormOutputModel_mapper.Counts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_output_model.setCounts(null);
|
} else {
|
wh_form_output_model.setCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormOutputModel_mapper.OutWhGoodsDetailsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_output_model.setOutWhGoodsDetailsId(null);
|
} else {
|
wh_form_output_model.setOutWhGoodsDetailsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormOutputModel_mapper.WhGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_output_model.setWhGoodsId(null);
|
} else {
|
wh_form_output_model.setWhGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormOutputModel_mapper.WhFormOutputId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_output_model.setWhFormOutputId(null);
|
} else {
|
wh_form_output_model.setWhFormOutputId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, WhFormOutputModel_mapper.WhFormOutputGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
wh_form_output_model.setWhFormOutputGoodsId(null);
|
} else {
|
wh_form_output_model.setWhFormOutputGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
return wh_form_output_model;
|
}
|
}
|