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_BACK_MODEL *
|
* @author genrator
|
*/
|
public class DepFormBackModel_mapper extends DepFormBackModel implements BaseMapper<DepFormBackModel> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<DepFormBackModel> ROW_MAPPER = new DepFormBackModelRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String DepFormBackGoodsId = "dep_form_back_goods_id";
|
public static final String DepFormBackId = "dep_form_back_id";
|
public static final String WhGoodsDetailsId = "wh_goods_details_id";
|
public static final String UsingGoodsHisId = "using_goods_his_id";
|
public static final String WhGoodsId = "wh_goods_id";
|
public static final String Counts = "counts";
|
public static final String DepFormLendingModelId = "dep_form_lending_model_id";
|
public static final String DepFormLendingGoodsId = "dep_form_lending_goods_id";
|
public static final String DepFormLendingId = "dep_form_lending_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public DepFormBackModel_mapper(DepFormBackModel depFormBackModel) {
|
if (depFormBackModel == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (depFormBackModel.isset_id) {
|
this.setId(depFormBackModel.getId());
|
}
|
//普通属性
|
if (depFormBackModel.isset_depFormBackGoodsId) {
|
this.setDepFormBackGoodsId(depFormBackModel.getDepFormBackGoodsId());
|
}
|
if (depFormBackModel.isset_depFormBackId) {
|
this.setDepFormBackId(depFormBackModel.getDepFormBackId());
|
}
|
if (depFormBackModel.isset_whGoodsDetailsId) {
|
this.setWhGoodsDetailsId(depFormBackModel.getWhGoodsDetailsId());
|
}
|
if (depFormBackModel.isset_usingGoodsHisId) {
|
this.setUsingGoodsHisId(depFormBackModel.getUsingGoodsHisId());
|
}
|
if (depFormBackModel.isset_whGoodsId) {
|
this.setWhGoodsId(depFormBackModel.getWhGoodsId());
|
}
|
if (depFormBackModel.isset_counts) {
|
this.setCounts(depFormBackModel.getCounts());
|
}
|
if (depFormBackModel.isset_depFormLendingModelId) {
|
this.setDepFormLendingModelId(depFormBackModel.getDepFormLendingModelId());
|
}
|
if (depFormBackModel.isset_depFormLendingGoodsId) {
|
this.setDepFormLendingGoodsId(depFormBackModel.getDepFormLendingGoodsId());
|
}
|
if (depFormBackModel.isset_depFormLendingId) {
|
this.setDepFormLendingId(depFormBackModel.getDepFormLendingId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(dep_form_back_model.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "dep_form_back_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(DepFormBackGoodsId, this.getDepFormBackGoodsId(), this.isset_depFormBackGoodsId);
|
ib.set(DepFormBackId, this.getDepFormBackId(), this.isset_depFormBackId);
|
ib.set(WhGoodsDetailsId, this.getWhGoodsDetailsId(), this.isset_whGoodsDetailsId);
|
ib.set(UsingGoodsHisId, this.getUsingGoodsHisId(), this.isset_usingGoodsHisId);
|
ib.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ib.set(Counts, this.getCounts(), this.isset_counts);
|
ib.set(DepFormLendingModelId, this.getDepFormLendingModelId(), this.isset_depFormLendingModelId);
|
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(DepFormBackGoodsId, this.getDepFormBackGoodsId(), this.isset_depFormBackGoodsId);
|
ub.set(DepFormBackId, this.getDepFormBackId(), this.isset_depFormBackId);
|
ub.set(WhGoodsDetailsId, this.getWhGoodsDetailsId(), this.isset_whGoodsDetailsId);
|
ub.set(UsingGoodsHisId, this.getUsingGoodsHisId(), this.isset_usingGoodsHisId);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(DepFormLendingModelId, this.getDepFormLendingModelId(), this.isset_depFormLendingModelId);
|
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(DepFormBackGoodsId, this.getDepFormBackGoodsId(), this.isset_depFormBackGoodsId);
|
ub.set(DepFormBackId, this.getDepFormBackId(), this.isset_depFormBackId);
|
ub.set(WhGoodsDetailsId, this.getWhGoodsDetailsId(), this.isset_whGoodsDetailsId);
|
ub.set(UsingGoodsHisId, this.getUsingGoodsHisId(), this.isset_usingGoodsHisId);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(DepFormLendingModelId, this.getDepFormLendingModelId(), this.isset_depFormLendingModelId);
|
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(DepFormBackGoodsId, this.getDepFormBackGoodsId(), this.isset_depFormBackGoodsId);
|
ub.set(DepFormBackId, this.getDepFormBackId(), this.isset_depFormBackId);
|
ub.set(WhGoodsDetailsId, this.getWhGoodsDetailsId(), this.isset_whGoodsDetailsId);
|
ub.set(UsingGoodsHisId, this.getUsingGoodsHisId(), this.isset_usingGoodsHisId);
|
ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId);
|
ub.set(Counts, this.getCounts(), this.isset_counts);
|
ub.set(DepFormLendingModelId, this.getDepFormLendingModelId(), this.isset_depFormLendingModelId);
|
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, dep_form_back_goods_id, dep_form_back_id, wh_goods_details_id, using_goods_his_id, wh_goods_id, counts, dep_form_lending_model_id, 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, dep_form_back_goods_id, dep_form_back_id, wh_goods_details_id, using_goods_his_id, wh_goods_id, counts, dep_form_lending_model_id, dep_form_lending_goods_id, dep_form_lending_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public DepFormBackModel mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public DepFormBackModel toDepFormBackModel() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* dep_form_back_model RowMapper
|
*
|
* @author genrator
|
*/
|
class DepFormBackModelRowMapper implements RowMapper<DepFormBackModel> {
|
|
@Override
|
public DepFormBackModel mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
DepFormBackModel dep_form_back_model = new DepFormBackModel();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.Id);
|
if (columnIndex > 0) {
|
dep_form_back_model.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.DepFormBackGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back_model.setDepFormBackGoodsId(null);
|
} else {
|
dep_form_back_model.setDepFormBackGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.DepFormBackId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back_model.setDepFormBackId(null);
|
} else {
|
dep_form_back_model.setDepFormBackId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.WhGoodsDetailsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back_model.setWhGoodsDetailsId(null);
|
} else {
|
dep_form_back_model.setWhGoodsDetailsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.UsingGoodsHisId);
|
if (columnIndex > 0) {
|
dep_form_back_model.setUsingGoodsHisId(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.WhGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back_model.setWhGoodsId(null);
|
} else {
|
dep_form_back_model.setWhGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.Counts);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back_model.setCounts(null);
|
} else {
|
dep_form_back_model.setCounts(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.DepFormLendingModelId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back_model.setDepFormLendingModelId(null);
|
} else {
|
dep_form_back_model.setDepFormLendingModelId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.DepFormLendingGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back_model.setDepFormLendingGoodsId(null);
|
} else {
|
dep_form_back_model.setDepFormLendingGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.DepFormLendingId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back_model.setDepFormLendingId(null);
|
} else {
|
dep_form_back_model.setDepFormLendingId(rs.getLong(columnIndex));
|
}
|
}
|
return dep_form_back_model;
|
}
|
}
|