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;
|
|
/**
|
* 表名: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 BaseGoodsTemplateId = "base_goods_template_id";
|
public static final String GoodsTemplateName = "goods_template_name";
|
public static final String Unit = "unit";
|
public static final String BaseGoodsModelsId = "base_goods_models_id";
|
public static final String BaseGoodsModelsName = "base_goods_models_name";
|
public static final String ScrappedCounts = "scrapped_counts";
|
public static final String InitCount = "init_count";
|
public static final String DepFormScrappedId = "dep_form_scrapped_id";
|
public static final String Beiz = "beiz";
|
public static final String ScrappedCode = "scrapped_code";
|
public static final String ScrappedName = "scrapped_name";
|
public static final String DepFormLendingGoodsId = "dep_form_lending_goods_id";
|
public static final String DepFormLendingId = "dep_form_lending_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public DepFormScrappedGoods_mapper(DepFormScrappedGoods depFormScrappedGoods) {
|
if (depFormScrappedGoods == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (depFormScrappedGoods.isset_id) {
|
this.setId(depFormScrappedGoods.getId());
|
}
|
//普通属性
|
if (depFormScrappedGoods.isset_baseGoodsTemplateId) {
|
this.setBaseGoodsTemplateId(depFormScrappedGoods.getBaseGoodsTemplateId());
|
}
|
if (depFormScrappedGoods.isset_goodsTemplateName) {
|
this.setGoodsTemplateName(depFormScrappedGoods.getGoodsTemplateName());
|
}
|
if (depFormScrappedGoods.isset_unit) {
|
this.setUnit(depFormScrappedGoods.getUnit());
|
}
|
if (depFormScrappedGoods.isset_baseGoodsModelsId) {
|
this.setBaseGoodsModelsId(depFormScrappedGoods.getBaseGoodsModelsId());
|
}
|
if (depFormScrappedGoods.isset_baseGoodsModelsName) {
|
this.setBaseGoodsModelsName(depFormScrappedGoods.getBaseGoodsModelsName());
|
}
|
if (depFormScrappedGoods.isset_scrappedCounts) {
|
this.setScrappedCounts(depFormScrappedGoods.getScrappedCounts());
|
}
|
if (depFormScrappedGoods.isset_initCount) {
|
this.setInitCount(depFormScrappedGoods.getInitCount());
|
}
|
if (depFormScrappedGoods.isset_depFormScrappedId) {
|
this.setDepFormScrappedId(depFormScrappedGoods.getDepFormScrappedId());
|
}
|
if (depFormScrappedGoods.isset_beiz) {
|
this.setBeiz(depFormScrappedGoods.getBeiz());
|
}
|
if (depFormScrappedGoods.isset_scrappedCode) {
|
this.setScrappedCode(depFormScrappedGoods.getScrappedCode());
|
}
|
if (depFormScrappedGoods.isset_scrappedName) {
|
this.setScrappedName(depFormScrappedGoods.getScrappedName());
|
}
|
if (depFormScrappedGoods.isset_depFormLendingGoodsId) {
|
this.setDepFormLendingGoodsId(depFormScrappedGoods.getDepFormLendingGoodsId());
|
}
|
if (depFormScrappedGoods.isset_depFormLendingId) {
|
this.setDepFormLendingId(depFormScrappedGoods.getDepFormLendingId());
|
}
|
// 去掉,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(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ib.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ib.set(Unit, this.getUnit(), this.isset_unit);
|
ib.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ib.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ib.set(ScrappedCounts, this.getScrappedCounts(), this.isset_scrappedCounts);
|
ib.set(InitCount, this.getInitCount(), this.isset_initCount);
|
ib.set(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId);
|
ib.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ib.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode);
|
ib.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName);
|
ib.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId);
|
ib.set(DepFormLendingId, this.getDepFormLendingId(), this.isset_depFormLendingId);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Unit, this.getUnit(), this.isset_unit);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ub.set(ScrappedCounts, this.getScrappedCounts(), this.isset_scrappedCounts);
|
ub.set(InitCount, this.getInitCount(), this.isset_initCount);
|
ub.set(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode);
|
ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName);
|
ub.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId);
|
ub.set(DepFormLendingId, this.getDepFormLendingId(), this.isset_depFormLendingId);
|
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(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Unit, this.getUnit(), this.isset_unit);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ub.set(ScrappedCounts, this.getScrappedCounts(), this.isset_scrappedCounts);
|
ub.set(InitCount, this.getInitCount(), this.isset_initCount);
|
ub.set(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode);
|
ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName);
|
ub.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId);
|
ub.set(DepFormLendingId, this.getDepFormLendingId(), this.isset_depFormLendingId);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId);
|
ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName);
|
ub.set(Unit, this.getUnit(), this.isset_unit);
|
ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId);
|
ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName);
|
ub.set(ScrappedCounts, this.getScrappedCounts(), this.isset_scrappedCounts);
|
ub.set(InitCount, this.getInitCount(), this.isset_initCount);
|
ub.set(DepFormScrappedId, this.getDepFormScrappedId(), this.isset_depFormScrappedId);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode);
|
ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName);
|
ub.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId);
|
ub.set(DepFormLendingId, this.getDepFormLendingId(), this.isset_depFormLendingId);
|
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, base_goods_template_id, goods_template_name, unit, base_goods_models_id, base_goods_models_name, scrapped_counts, init_count, dep_form_scrapped_id, beiz, scrapped_code, scrapped_name, dep_form_lending_goods_id, dep_form_lending_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, base_goods_template_id, goods_template_name, unit, base_goods_models_id, base_goods_models_name, scrapped_counts, init_count, dep_form_scrapped_id, beiz, scrapped_code, scrapped_name, dep_form_lending_goods_id, dep_form_lending_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.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.GoodsTemplateName);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setGoodsTemplateName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.Unit);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setUnit(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.BaseGoodsModelsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setBaseGoodsModelsId(null);
|
} else {
|
dep_form_scrapped_goods.setBaseGoodsModelsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.BaseGoodsModelsName);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setBaseGoodsModelsName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.ScrappedCounts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setScrappedCounts(null);
|
} else {
|
dep_form_scrapped_goods.setScrappedCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.InitCount);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setInitCount(null);
|
} else {
|
dep_form_scrapped_goods.setInitCount(rs.getInt(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.Beiz);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setBeiz(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.ScrappedCode);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setScrappedCode(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.ScrappedName);
|
if (columnIndex > 0) {
|
dep_form_scrapped_goods.setScrappedName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.DepFormLendingGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setDepFormLendingGoodsId(null);
|
} else {
|
dep_form_scrapped_goods.setDepFormLendingGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedGoods_mapper.DepFormLendingId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_scrapped_goods.setDepFormLendingId(null);
|
} else {
|
dep_form_scrapped_goods.setDepFormLendingId(rs.getLong(columnIndex));
|
}
|
}
|
return dep_form_scrapped_goods;
|
}
|
}
|