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_LENDING *
|
* @author genrator
|
*/
|
public class DepFormLending_mapper extends DepFormLending implements BaseMapper<DepFormLending> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<DepFormLending> ROW_MAPPER = new DepFormLendingRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String BusinessFormName = "business_form_name";
|
public static final String BusinessFormCode = "business_form_code";
|
public static final String OperatorId = "operator_id";
|
public static final String OperatorName = "operator_name";
|
public static final String ReceiverName = "receiver_name";
|
public static final String ReceiverPhone = "receiver_phone";
|
public static final String DealTime = "deal_time";
|
public static final String AgencyId = "agency_id";
|
public static final String AgencyName = "agency_name";
|
public static final String DepartmentId = "department_id";
|
public static final String DepartmentName = "department_name";
|
public static final String Beiz = "beiz";
|
public static final String UploadFiles = "upload_files";
|
public static final String UsingCount = "using_count";
|
public static final String WarehouseId = "warehouse_id";
|
public static final String WarehouseName = "warehouse_name";
|
|
/**
|
* 默认构造函数
|
*/
|
public DepFormLending_mapper(DepFormLending depFormLending) {
|
if (depFormLending == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (depFormLending.isset_id) {
|
this.setId(depFormLending.getId());
|
}
|
//普通属性
|
if (depFormLending.isset_businessFormName) {
|
this.setBusinessFormName(depFormLending.getBusinessFormName());
|
}
|
if (depFormLending.isset_businessFormCode) {
|
this.setBusinessFormCode(depFormLending.getBusinessFormCode());
|
}
|
if (depFormLending.isset_operatorId) {
|
this.setOperatorId(depFormLending.getOperatorId());
|
}
|
if (depFormLending.isset_operatorName) {
|
this.setOperatorName(depFormLending.getOperatorName());
|
}
|
if (depFormLending.isset_receiverName) {
|
this.setReceiverName(depFormLending.getReceiverName());
|
}
|
if (depFormLending.isset_receiverPhone) {
|
this.setReceiverPhone(depFormLending.getReceiverPhone());
|
}
|
if (depFormLending.isset_dealTime) {
|
this.setDealTime(depFormLending.getDealTime());
|
}
|
if (depFormLending.isset_agencyId) {
|
this.setAgencyId(depFormLending.getAgencyId());
|
}
|
if (depFormLending.isset_agencyName) {
|
this.setAgencyName(depFormLending.getAgencyName());
|
}
|
if (depFormLending.isset_departmentId) {
|
this.setDepartmentId(depFormLending.getDepartmentId());
|
}
|
if (depFormLending.isset_departmentName) {
|
this.setDepartmentName(depFormLending.getDepartmentName());
|
}
|
if (depFormLending.isset_beiz) {
|
this.setBeiz(depFormLending.getBeiz());
|
}
|
if (depFormLending.isset_uploadFiles) {
|
this.setUploadFiles(depFormLending.getUploadFiles());
|
}
|
if (depFormLending.isset_usingCount) {
|
this.setUsingCount(depFormLending.getUsingCount());
|
}
|
if (depFormLending.isset_warehouseId) {
|
this.setWarehouseId(depFormLending.getWarehouseId());
|
}
|
if (depFormLending.isset_warehouseName) {
|
this.setWarehouseName(depFormLending.getWarehouseName());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(dep_form_lending.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "dep_form_lending";
|
/**
|
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(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName);
|
ib.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ib.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ib.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ib.set(ReceiverName, this.getReceiverName(), this.isset_receiverName);
|
ib.set(ReceiverPhone, this.getReceiverPhone(), this.isset_receiverPhone);
|
ib.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ib.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ib.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ib.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId);
|
ib.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName);
|
ib.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ib.set(UploadFiles, this.getUploadFiles(), this.isset_uploadFiles);
|
ib.set(UsingCount, this.getUsingCount(), this.isset_usingCount);
|
ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ib.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName);
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(ReceiverName, this.getReceiverName(), this.isset_receiverName);
|
ub.set(ReceiverPhone, this.getReceiverPhone(), this.isset_receiverPhone);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId);
|
ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(UploadFiles, this.getUploadFiles(), this.isset_uploadFiles);
|
ub.set(UsingCount, this.getUsingCount(), this.isset_usingCount);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
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(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName);
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(ReceiverName, this.getReceiverName(), this.isset_receiverName);
|
ub.set(ReceiverPhone, this.getReceiverPhone(), this.isset_receiverPhone);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId);
|
ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(UploadFiles, this.getUploadFiles(), this.isset_uploadFiles);
|
ub.set(UsingCount, this.getUsingCount(), this.isset_usingCount);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(BusinessFormName, this.getBusinessFormName(), this.isset_businessFormName);
|
ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(ReceiverName, this.getReceiverName(), this.isset_receiverName);
|
ub.set(ReceiverPhone, this.getReceiverPhone(), this.isset_receiverPhone);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId);
|
ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName);
|
ub.set(DepartmentId, this.getDepartmentId(), this.isset_departmentId);
|
ub.set(DepartmentName, this.getDepartmentName(), this.isset_departmentName);
|
ub.set(Beiz, this.getBeiz(), this.isset_beiz);
|
ub.set(UploadFiles, this.getUploadFiles(), this.isset_uploadFiles);
|
ub.set(UsingCount, this.getUsingCount(), this.isset_usingCount);
|
ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId);
|
ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName);
|
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_name, business_form_code, operator_id, operator_name, receiver_name, receiver_phone, deal_time, agency_id, agency_name, department_id, department_name, beiz, upload_files, using_count, warehouse_id, warehouse_name from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, business_form_name, business_form_code, operator_id, operator_name, receiver_name, receiver_phone, deal_time, agency_id, agency_name, department_id, department_name, beiz, upload_files, using_count, warehouse_id, warehouse_name from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public DepFormLending mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public DepFormLending toDepFormLending() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* dep_form_lending RowMapper
|
*
|
* @author genrator
|
*/
|
class DepFormLendingRowMapper implements RowMapper<DepFormLending> {
|
|
@Override
|
public DepFormLending mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
DepFormLending dep_form_lending = new DepFormLending();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.Id);
|
if (columnIndex > 0) {
|
dep_form_lending.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.BusinessFormName);
|
if (columnIndex > 0) {
|
dep_form_lending.setBusinessFormName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.BusinessFormCode);
|
if (columnIndex > 0) {
|
dep_form_lending.setBusinessFormCode(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.OperatorId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending.setOperatorId(null);
|
} else {
|
dep_form_lending.setOperatorId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.OperatorName);
|
if (columnIndex > 0) {
|
dep_form_lending.setOperatorName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.ReceiverName);
|
if (columnIndex > 0) {
|
dep_form_lending.setReceiverName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.ReceiverPhone);
|
if (columnIndex > 0) {
|
dep_form_lending.setReceiverPhone(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.DealTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending.setDealTime(null);
|
} else {
|
dep_form_lending.setDealTime(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.AgencyId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending.setAgencyId(null);
|
} else {
|
dep_form_lending.setAgencyId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.AgencyName);
|
if (columnIndex > 0) {
|
dep_form_lending.setAgencyName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.DepartmentId);
|
if (columnIndex > 0) {
|
dep_form_lending.setDepartmentId(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.DepartmentName);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending.setDepartmentName(null);
|
} else {
|
dep_form_lending.setDepartmentName(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.Beiz);
|
if (columnIndex > 0) {
|
dep_form_lending.setBeiz(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.UploadFiles);
|
if (columnIndex > 0) {
|
dep_form_lending.setUploadFiles(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.UsingCount);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending.setUsingCount(null);
|
} else {
|
dep_form_lending.setUsingCount(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.WarehouseId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending.setWarehouseId(null);
|
} else {
|
dep_form_lending.setWarehouseId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLending_mapper.WarehouseName);
|
if (columnIndex > 0) {
|
dep_form_lending.setWarehouseName(rs.getString(columnIndex));
|
}
|
return dep_form_lending;
|
}
|
}
|