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;
|
|
/**
|
* 表名:L_WH_FORM_PROCURE_GOODS *
|
* @author genrator
|
*/
|
public class LWhFormProcureGoods_mapper extends LWhFormProcureGoods implements BaseMapper<LWhFormProcureGoods> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<LWhFormProcureGoods> ROW_MAPPER = new LWhFormProcureGoodsRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String WhFormProcureId = "wh_form_procure_id";
|
public static final String BaseCategoryId = "base_category_id";
|
public static final String BaseGoodsTemplateId = "base_goods_template_id";
|
public static final String GoodsTemplateName = "goods_template_name";
|
public static final String Supplier = "supplier";
|
public static final String Sort = "sort";
|
|
/**
|
* 默认构造函数
|
*/
|
public LWhFormProcureGoods_mapper(LWhFormProcureGoods lWhFormProcureGoods) {
|
if (lWhFormProcureGoods == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (lWhFormProcureGoods.isset_id) {
|
this.setId(lWhFormProcureGoods.getId());
|
}
|
//普通属性
|
if (lWhFormProcureGoods.isset_whFormProcureId) {
|
this.setWhFormProcureId(lWhFormProcureGoods.getWhFormProcureId());
|
}
|
if (lWhFormProcureGoods.isset_baseCategoryId) {
|
this.setBaseCategoryId(lWhFormProcureGoods.getBaseCategoryId());
|
}
|
if (lWhFormProcureGoods.isset_baseGoodsTemplateId) {
|
this.setBaseGoodsTemplateId(lWhFormProcureGoods.getBaseGoodsTemplateId());
|
}
|
if (lWhFormProcureGoods.isset_goodsTemplateName) {
|
this.setGoodsTemplateName(lWhFormProcureGoods.getGoodsTemplateName());
|
}
|
if (lWhFormProcureGoods.isset_supplier) {
|
this.setSupplier(lWhFormProcureGoods.getSupplier());
|
}
|
if (lWhFormProcureGoods.isset_sort) {
|
this.setSort(lWhFormProcureGoods.getSort());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(l_wh_form_procure_goods.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "l_wh_form_procure_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(WhFormProcureId, this.getWhFormProcureId(), this.isset_whFormProcureId);
|
ib.set(BaseCategoryId, this.getBaseCategoryId(), this.isset_baseCategoryId);
|
ib.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ib.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ib.set(Supplier, this.getSupplier(), this.isset_supplier);
|
ib.set(Sort, this.getSort(), this.isset_sort);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(WhFormProcureId, this.getWhFormProcureId(), this.isset_whFormProcureId);
|
ub.set(BaseCategoryId, this.getBaseCategoryId(), this.isset_baseCategoryId);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Supplier, this.getSupplier(), this.isset_supplier);
|
ub.set(Sort, this.getSort(), this.isset_sort);
|
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(WhFormProcureId, this.getWhFormProcureId(), this.isset_whFormProcureId);
|
ub.set(BaseCategoryId, this.getBaseCategoryId(), this.isset_baseCategoryId);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Supplier, this.getSupplier(), this.isset_supplier);
|
ub.set(Sort, this.getSort(), this.isset_sort);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(WhFormProcureId, this.getWhFormProcureId(), this.isset_whFormProcureId);
|
ub.set(BaseCategoryId, this.getBaseCategoryId(), this.isset_baseCategoryId);
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Supplier, this.getSupplier(), this.isset_supplier);
|
ub.set(Sort, this.getSort(), this.isset_sort);
|
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_procure_id, base_category_id, base_goods_template_id, goods_template_name, supplier, sort from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, wh_form_procure_id, base_category_id, base_goods_template_id, goods_template_name, supplier, sort from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public LWhFormProcureGoods mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public LWhFormProcureGoods toLWhFormProcureGoods() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* l_wh_form_procure_goods RowMapper
|
*
|
* @author genrator
|
*/
|
class LWhFormProcureGoodsRowMapper implements RowMapper<LWhFormProcureGoods> {
|
|
@Override
|
public LWhFormProcureGoods mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
LWhFormProcureGoods l_wh_form_procure_goods = new LWhFormProcureGoods();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcureGoods_mapper.Id);
|
if (columnIndex > 0) {
|
l_wh_form_procure_goods.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcureGoods_mapper.WhFormProcureId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure_goods.setWhFormProcureId(null);
|
} else {
|
l_wh_form_procure_goods.setWhFormProcureId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcureGoods_mapper.BaseCategoryId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure_goods.setBaseCategoryId(null);
|
} else {
|
l_wh_form_procure_goods.setBaseCategoryId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcureGoods_mapper.BaseGoodsTemplateId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure_goods.setBaseGoodsTemplateId(null);
|
} else {
|
l_wh_form_procure_goods.setBaseGoodsTemplateId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcureGoods_mapper.GoodsTemplateName);
|
if (columnIndex > 0) {
|
l_wh_form_procure_goods.setGoodsTemplateName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcureGoods_mapper.Supplier);
|
if (columnIndex > 0) {
|
l_wh_form_procure_goods.setSupplier(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, LWhFormProcureGoods_mapper.Sort);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
l_wh_form_procure_goods.setSort(null);
|
} else {
|
l_wh_form_procure_goods.setSort(rs.getInt(columnIndex));
|
}
|
}
|
return l_wh_form_procure_goods;
|
}
|
}
|