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 org.springframework.jdbc.core.RowMapper;
|
|
import java.sql.ResultSet;
|
import java.sql.SQLException;
|
import java.util.Map;
|
|
/**
|
* 表名:DEP_FORM_SCRAPPED_GOODS
|
*
|
* @author genrator
|
*/
|
public class DepFormScrappedGoods_mapper extends DepFormScrappedGoods implements BaseMapper<DepFormScrappedGoods> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<DepFormScrappedGoods> ROW_MAPPER = new DepFormScrappedGoodsRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String DepFormScrappedId = "dep_form_scrapped_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 DepFormScrappedGoods_mapper(DepFormScrappedGoods depFormScrappedGoods) {
|
if (depFormScrappedGoods == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (depFormScrappedGoods.isset_id) {
|
this.setId(depFormScrappedGoods.getId());
|
}
|
//普通属性
|
if (depFormScrappedGoods.isset_depFormScrappedId) {
|
this.setDepFormScrappedId(depFormScrappedGoods.getDepFormScrappedId());
|
}
|
if (depFormScrappedGoods.isset_baseGoodsTemplateId) {
|
this.setBaseGoodsTemplateId(depFormScrappedGoods.getBaseGoodsTemplateId());
|
}
|
if (depFormScrappedGoods.isset_baseGoodsTemplateName) {
|
this.setBaseGoodsTemplateName(depFormScrappedGoods.getBaseGoodsTemplateName());
|
}
|
if (depFormScrappedGoods.isset_categoryName) {
|
this.setCategoryName(depFormScrappedGoods.getCategoryName());
|
}
|
if (depFormScrappedGoods.isset_classification) {
|
this.setClassification(depFormScrappedGoods.getClassification());
|
}
|
if (depFormScrappedGoods.isset_transBusinessId) {
|
this.setTransBusinessId(depFormScrappedGoods.getTransBusinessId());
|
}
|
if (depFormScrappedGoods.isset_businessFormCode) {
|
this.setBusinessFormCode(depFormScrappedGoods.getBusinessFormCode());
|
}
|
if (depFormScrappedGoods.isset_transOutWarehouseType) {
|
this.setTransOutWarehouseType(depFormScrappedGoods.getTransOutWarehouseType());
|
}
|
if (depFormScrappedGoods.isset_transOutWarehouseId) {
|
this.setTransOutWarehouseId(depFormScrappedGoods.getTransOutWarehouseId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(dep_form_scrapped_goods.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "dep_form_scrapped_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(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId);
|
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(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId);
|
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(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId);
|
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(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId);
|
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, dep_form_scrapped_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, dep_form_scrapped_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 DepFormScrappedGoods mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public DepFormScrappedGoods toDepFormScrappedGoods() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* dep_form_scrapped_goods RowMapper
|
*
|
* @author genrator
|
*/
|
class DepFormScrappedGoodsRowMapper implements RowMapper<DepFormScrappedGoods> {
|
|
@Override
|
public DepFormScrappedGoods mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
DepFormScrappedGoods dep_form_scrapped_goods = new DepFormScrappedGoods();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.Id);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.DepFormScrappedId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setDepFormScrappedId(null);
|
} else {
|
dep_form_scrapped_goods.setDepFormScrappedId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.BaseGoodsTemplateId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setBaseGoodsTemplateId(null);
|
} else {
|
dep_form_scrapped_goods.setBaseGoodsTemplateId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.BaseGoodsTemplateName);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setBaseGoodsTemplateName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.CategoryName);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setCategoryName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.Classification);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setClassification(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.TransBusinessId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setTransBusinessId(null);
|
} else {
|
dep_form_scrapped_goods.setTransBusinessId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.BusinessFormCode);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setBusinessFormCode(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.TransOutWarehouseType);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setTransOutWarehouseType(null);
|
} else {
|
dep_form_scrapped_goods.setTransOutWarehouseType(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.TransOutWarehouseId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setTransOutWarehouseId(null);
|
} else {
|
dep_form_scrapped_goods.setTransOutWarehouseId(rs.getLong(columnIndex));
|
}
|
}
|
return dep_form_scrapped_goods;
|
}
|
}
|