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 java.sql.ResultSet;
|
import java.sql.SQLException;
|
import java.util.Map;
|
import org.springframework.jdbc.core.RowMapper;
|
|
/**
|
* 表名:USING_FORM_BACK_GOODS
|
*
|
* @author genrator
|
*/
|
public class UsingFormBackGoods_mapper extends UsingFormBackGoods implements BaseMapper<UsingFormBackGoods> {
|
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<UsingFormBackGoods> ROW_MAPPER = new UsingFormBackGoodsRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String UsingFormBackId = "using_form_back_id";
|
public static final String BaseGoodsTemplateId = "base_goods_template_id";
|
public static final String BaseGoodsTemplateName = "base_goods_template_name";
|
public static final String CategoryName = "category_name";
|
public static final String Classification = "classification";
|
public static final String TransBusinessId = "trans_business_id";
|
public static final String BusinessFormCode = "business_form_code";
|
public static final String TransOutWarehouseType = "trans_out_warehouse_type";
|
public static final String TransOutWarehouseId = "trans_out_warehouse_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public UsingFormBackGoods_mapper(UsingFormBackGoods usingFormBackGoods) {
|
if (usingFormBackGoods == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (usingFormBackGoods.isset_id) {
|
this.setId(usingFormBackGoods.getId());
|
}
|
//普通属性
|
if (usingFormBackGoods.isset_usingFormBackId) {
|
this.setUsingFormBackId(usingFormBackGoods.getUsingFormBackId());
|
}
|
if (usingFormBackGoods.isset_baseGoodsTemplateId) {
|
this.setBaseGoodsTemplateId(usingFormBackGoods.getBaseGoodsTemplateId());
|
}
|
if (usingFormBackGoods.isset_baseGoodsTemplateName) {
|
this.setBaseGoodsTemplateName(usingFormBackGoods.getBaseGoodsTemplateName());
|
}
|
if (usingFormBackGoods.isset_categoryName) {
|
this.setCategoryName(usingFormBackGoods.getCategoryName());
|
}
|
if (usingFormBackGoods.isset_classification) {
|
this.setClassification(usingFormBackGoods.getClassification());
|
}
|
if (usingFormBackGoods.isset_transBusinessId) {
|
this.setTransBusinessId(usingFormBackGoods.getTransBusinessId());
|
}
|
if (usingFormBackGoods.isset_businessFormCode) {
|
this.setBusinessFormCode(usingFormBackGoods.getBusinessFormCode());
|
}
|
if (usingFormBackGoods.isset_transOutWarehouseType) {
|
this.setTransOutWarehouseType(usingFormBackGoods.getTransOutWarehouseType());
|
}
|
if (usingFormBackGoods.isset_transOutWarehouseId) {
|
this.setTransOutWarehouseId(usingFormBackGoods.getTransOutWarehouseId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(using_form_back_goods.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "using_form_back_goods";
|
/**
|
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(UsingFormBackId, this.getUsingFormBackId(), this.isset_usingFormBackId);
|
ib.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ib.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName);
|
ib.set(CategoryName, this.getCategoryName(), this.isset_categoryName);
|
ib.set(Classification, this.getClassification(), this.isset_classification);
|
ib.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId);
|
ib.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ib.set(TransOutWarehouseType, this.getTransOutWarehouseType(), this.isset_transOutWarehouseType);
|
ib.set(TransOutWarehouseId, this.getTransOutWarehouseId(), this.isset_transOutWarehouseId);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(UsingFormBackId, this.getUsingFormBackId(), this.isset_usingFormBackId);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName);
|
ub.set(CategoryName, this.getCategoryName(), this.isset_categoryName);
|
ub.set(Classification, this.getClassification(), this.isset_classification);
|
ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId);
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(TransOutWarehouseType, this.getTransOutWarehouseType(), this.isset_transOutWarehouseType);
|
ub.set(TransOutWarehouseId, this.getTransOutWarehouseId(), this.isset_transOutWarehouseId);
|
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(UsingFormBackId, this.getUsingFormBackId(), this.isset_usingFormBackId);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName);
|
ub.set(CategoryName, this.getCategoryName(), this.isset_categoryName);
|
ub.set(Classification, this.getClassification(), this.isset_classification);
|
ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId);
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(TransOutWarehouseType, this.getTransOutWarehouseType(), this.isset_transOutWarehouseType);
|
ub.set(TransOutWarehouseId, this.getTransOutWarehouseId(), this.isset_transOutWarehouseId);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(UsingFormBackId, this.getUsingFormBackId(), this.isset_usingFormBackId);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(BaseGoodsTemplateName, this.getBaseGoodsTemplateName(), this.isset_baseGoodsTemplateName);
|
ub.set(CategoryName, this.getCategoryName(), this.isset_categoryName);
|
ub.set(Classification, this.getClassification(), this.isset_classification);
|
ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId);
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(TransOutWarehouseType, this.getTransOutWarehouseType(), this.isset_transOutWarehouseType);
|
ub.set(TransOutWarehouseId, this.getTransOutWarehouseId(), this.isset_transOutWarehouseId);
|
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, using_form_back_id, base_goods_template_id, base_goods_template_name, category_name, classification, trans_business_id, business_form_code, trans_out_warehouse_type, trans_out_warehouse_id from "
|
+ this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>(
|
"select id, using_form_back_id, base_goods_template_id, base_goods_template_name, category_name, classification, trans_business_id, business_form_code, trans_out_warehouse_type, trans_out_warehouse_id from "
|
+ this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public UsingFormBackGoods mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public UsingFormBackGoods toUsingFormBackGoods() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* using_form_back_goods RowMapper
|
*
|
* @author genrator
|
*/
|
class UsingFormBackGoodsRowMapper implements RowMapper<UsingFormBackGoods> {
|
|
@Override
|
public UsingFormBackGoods mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
UsingFormBackGoods using_form_back_goods = new UsingFormBackGoods();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.Id);
|
if (columnIndex > 0) {
|
using_form_back_goods.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.UsingFormBackId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
using_form_back_goods.setUsingFormBackId(null);
|
} else {
|
using_form_back_goods.setUsingFormBackId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.BaseGoodsTemplateId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
using_form_back_goods.setBaseGoodsTemplateId(null);
|
} else {
|
using_form_back_goods.setBaseGoodsTemplateId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.BaseGoodsTemplateName);
|
if (columnIndex > 0) {
|
using_form_back_goods.setBaseGoodsTemplateName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.CategoryName);
|
if (columnIndex > 0) {
|
using_form_back_goods.setCategoryName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.Classification);
|
if (columnIndex > 0) {
|
using_form_back_goods.setClassification(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.TransBusinessId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
using_form_back_goods.setTransBusinessId(null);
|
} else {
|
using_form_back_goods.setTransBusinessId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.BusinessFormCode);
|
if (columnIndex > 0) {
|
using_form_back_goods.setBusinessFormCode(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.TransOutWarehouseType);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
using_form_back_goods.setTransOutWarehouseType(null);
|
} else {
|
using_form_back_goods.setTransOutWarehouseType(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, UsingFormBackGoods_mapper.TransOutWarehouseId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
using_form_back_goods.setTransOutWarehouseId(null);
|
} else {
|
using_form_back_goods.setTransOutWarehouseId(rs.getLong(columnIndex));
|
}
|
}
|
return using_form_back_goods;
|
}
|
}
|