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 *
|
* @author genrator
|
*/
|
public class DepFormBack_mapper extends DepFormBack implements BaseMapper<DepFormBack> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<DepFormBack> ROW_MAPPER = new DepFormBackRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String BusinessFormCode = "business_form_code";
|
public static final String WarehouseId = "warehouse_id";
|
public static final String WarehouseName = "warehouse_name";
|
public static final String OperatorId = "operator_id";
|
public static final String OperatorName = "operator_name";
|
public static final String DealTime = "deal_time";
|
public static final String DepartmentId = "department_id";
|
public static final String DepartmentName = "department_name";
|
public static final String AgencyId = "agency_id";
|
public static final String AgencyName = "agency_name";
|
public static final String States = "states";
|
public static final String Beiz = "beiz";
|
public static final String DepFormLendingId = "dep_form_lending_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public DepFormBack_mapper(DepFormBack depFormBack) {
|
if (depFormBack == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (depFormBack.isset_id) {
|
this.setId(depFormBack.getId());
|
}
|
//普通属性
|
if (depFormBack.isset_businessFormCode) {
|
this.setBusinessFormCode(depFormBack.getBusinessFormCode());
|
}
|
if (depFormBack.isset_warehouseId) {
|
this.setWarehouseId(depFormBack.getWarehouseId());
|
}
|
if (depFormBack.isset_warehouseName) {
|
this.setWarehouseName(depFormBack.getWarehouseName());
|
}
|
if (depFormBack.isset_operatorId) {
|
this.setOperatorId(depFormBack.getOperatorId());
|
}
|
if (depFormBack.isset_operatorName) {
|
this.setOperatorName(depFormBack.getOperatorName());
|
}
|
if (depFormBack.isset_dealTime) {
|
this.setDealTime(depFormBack.getDealTime());
|
}
|
if (depFormBack.isset_departmentId) {
|
this.setDepartmentId(depFormBack.getDepartmentId());
|
}
|
if (depFormBack.isset_departmentName) {
|
this.setDepartmentName(depFormBack.getDepartmentName());
|
}
|
if (depFormBack.isset_agencyId) {
|
this.setAgencyId(depFormBack.getAgencyId());
|
}
|
if (depFormBack.isset_agencyName) {
|
this.setAgencyName(depFormBack.getAgencyName());
|
}
|
if (depFormBack.isset_states) {
|
this.setStates(depFormBack.getStates());
|
}
|
if (depFormBack.isset_beiz) {
|
this.setBeiz(depFormBack.getBeiz());
|
}
|
if (depFormBack.isset_depFormLendingId) {
|
this.setDepFormLendingId(depFormBack.getDepFormLendingId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(dep_form_back.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "dep_form_back";
|
/**
|
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(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ib.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ib.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ib.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ib.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ib.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId);
|
ib.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName);
|
ib.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ib.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ib.set(States, this.getStates(), this.isset_states);
|
ib.set(Beiz, this.getBeiz(), this.isset_beiz);
|
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(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId);
|
ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(States, this.getStates(), this.isset_states);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
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(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId);
|
ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(States, this.getStates(), this.isset_states);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
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(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId);
|
ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(States, this.getStates(), this.isset_states);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
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, business_form_code, warehouse_id, warehouse_name, operator_id, operator_name, deal_time, department_id, department_name, agency_id, agency_name, states, beiz, dep_form_lending_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, business_form_code, warehouse_id, warehouse_name, operator_id, operator_name, deal_time, department_id, department_name, agency_id, agency_name, states, beiz, dep_form_lending_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public DepFormBack mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public DepFormBack toDepFormBack() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* dep_form_back RowMapper
|
*
|
* @author genrator
|
*/
|
class DepFormBackRowMapper implements RowMapper<DepFormBack> {
|
|
@Override
|
public DepFormBack mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
DepFormBack dep_form_back = new DepFormBack();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.Id);
|
if (columnIndex > 0) {
|
dep_form_back.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.BusinessFormCode);
|
if (columnIndex > 0) {
|
dep_form_back.setBusinessFormCode(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.WarehouseId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back.setWarehouseId(null);
|
} else {
|
dep_form_back.setWarehouseId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.WarehouseName);
|
if (columnIndex > 0) {
|
dep_form_back.setWarehouseName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.OperatorId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back.setOperatorId(null);
|
} else {
|
dep_form_back.setOperatorId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.OperatorName);
|
if (columnIndex > 0) {
|
dep_form_back.setOperatorName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.DealTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back.setDealTime(null);
|
} else {
|
dep_form_back.setDealTime(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.DepartmentId);
|
if (columnIndex > 0) {
|
dep_form_back.setDepartmentId(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.DepartmentName);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back.setDepartmentName(null);
|
} else {
|
dep_form_back.setDepartmentName(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.AgencyId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back.setAgencyId(null);
|
} else {
|
dep_form_back.setAgencyId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.AgencyName);
|
if (columnIndex > 0) {
|
dep_form_back.setAgencyName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.States);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back.setStates(null);
|
} else {
|
dep_form_back.setStates(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.Beiz);
|
if (columnIndex > 0) {
|
dep_form_back.setBeiz(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.DepFormLendingId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_back.setDepFormLendingId(null);
|
} else {
|
dep_form_back.setDepFormLendingId(rs.getLong(columnIndex));
|
}
|
}
|
return dep_form_back;
|
}
|
}
|