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 org.springframework.jdbc.core.RowMapper;
|
|
import java.sql.ResultSet;
|
import java.sql.SQLException;
|
import java.util.Map;
|
|
/**
|
* 表名:FIN_SYS_ORG *
|
*
|
* @author genrator
|
*/
|
public class FinSysOrg_mapper extends FinSysOrg implements BaseMapper<FinSysOrg> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<FinSysOrg> ROW_MAPPER = new FinSysOrgRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String Name = "name";
|
public static final String OrgCode = "org_code";
|
public static final String OrderNum = "order_num";
|
public static final String ParentId = "parent_id";
|
public static final String OrgType = "org_type";
|
public static final String TenantId = "tenant_id";
|
public static final String Summary = "summary";
|
public static final String CreateBy = "create_by";
|
public static final String CreateTime = "create_time";
|
public static final String UpdateBy = "update_by";
|
public static final String UpdateTime = "update_time";
|
public static final String Lv = "lv";
|
public static final String TempId = "temp_id";
|
public static final String IsDelete = "is_delete";
|
|
/**
|
* 默认构造函数
|
*/
|
public FinSysOrg_mapper(FinSysOrg finSysOrg) {
|
if (finSysOrg == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
// 主键
|
if (finSysOrg.isset_id) {
|
this.setId(finSysOrg.getId());
|
}
|
// 普通属性
|
if (finSysOrg.isset_name) {
|
this.setName(finSysOrg.getName());
|
}
|
if (finSysOrg.isset_orgCode) {
|
this.setOrgCode(finSysOrg.getOrgCode());
|
}
|
if (finSysOrg.isset_orderNum) {
|
this.setOrderNum(finSysOrg.getOrderNum());
|
}
|
if (finSysOrg.isset_parentId) {
|
this.setParentId(finSysOrg.getParentId());
|
}
|
if (finSysOrg.isset_orgType) {
|
this.setOrgType(finSysOrg.getOrgType());
|
}
|
if (finSysOrg.isset_tenantId) {
|
this.setTenantId(finSysOrg.getTenantId());
|
}
|
if (finSysOrg.isset_summary) {
|
this.setSummary(finSysOrg.getSummary());
|
}
|
if (finSysOrg.isset_createBy) {
|
this.setCreateBy(finSysOrg.getCreateBy());
|
}
|
if (finSysOrg.isset_createTime) {
|
this.setCreateTime(finSysOrg.getCreateTime());
|
}
|
if (finSysOrg.isset_updateBy) {
|
this.setUpdateBy(finSysOrg.getUpdateBy());
|
}
|
if (finSysOrg.isset_updateTime) {
|
this.setUpdateTime(finSysOrg.getUpdateTime());
|
}
|
if (finSysOrg.isset_lv) {
|
this.setLv(finSysOrg.getLv());
|
}
|
if (finSysOrg.isset_tempId) {
|
this.setTempId(finSysOrg.getTempId());
|
}
|
if (finSysOrg.isset_isDelete) {
|
this.setIsDelete(finSysOrg.getIsDelete());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(fin_sys_org.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "fin_sys_org";
|
/**
|
* 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(Name, this.getName(), this.isset_name);
|
ib.set(OrgCode, this.getOrgCode(), this.isset_orgCode);
|
ib.set(OrderNum, this.getOrderNum(), this.isset_orderNum);
|
ib.set(ParentId, this.getParentId(), this.isset_parentId);
|
ib.set(OrgType, this.getOrgType(), this.isset_orgType);
|
ib.set(TenantId, this.getTenantId(), this.isset_tenantId);
|
ib.set(Summary, this.getSummary(), this.isset_summary);
|
ib.set(CreateBy, this.getCreateBy(), this.isset_createBy);
|
ib.set(CreateTime, this.getCreateTime(), this.isset_createTime);
|
ib.set(UpdateBy, this.getUpdateBy(), this.isset_updateBy);
|
ib.set(UpdateTime, this.getUpdateTime(), this.isset_updateTime);
|
ib.set(Lv, this.getLv(), this.isset_lv);
|
ib.set(TempId, this.getTempId(), this.isset_tempId);
|
ib.set(IsDelete, this.getIsDelete(), this.isset_isDelete);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(Name, this.getName(), this.isset_name);
|
ub.set(OrgCode, this.getOrgCode(), this.isset_orgCode);
|
ub.set(OrderNum, this.getOrderNum(), this.isset_orderNum);
|
ub.set(ParentId, this.getParentId(), this.isset_parentId);
|
ub.set(OrgType, this.getOrgType(), this.isset_orgType);
|
ub.set(TenantId, this.getTenantId(), this.isset_tenantId);
|
ub.set(Summary, this.getSummary(), this.isset_summary);
|
ub.set(CreateBy, this.getCreateBy(), this.isset_createBy);
|
ub.set(CreateTime, this.getCreateTime(), this.isset_createTime);
|
ub.set(UpdateBy, this.getUpdateBy(), this.isset_updateBy);
|
ub.set(UpdateTime, this.getUpdateTime(), this.isset_updateTime);
|
ub.set(Lv, this.getLv(), this.isset_lv);
|
ub.set(TempId, this.getTempId(), this.isset_tempId);
|
ub.set(IsDelete, this.getIsDelete(), this.isset_isDelete);
|
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(Name, this.getName(), this.isset_name);
|
ub.set(OrgCode, this.getOrgCode(), this.isset_orgCode);
|
ub.set(OrderNum, this.getOrderNum(), this.isset_orderNum);
|
ub.set(ParentId, this.getParentId(), this.isset_parentId);
|
ub.set(OrgType, this.getOrgType(), this.isset_orgType);
|
ub.set(TenantId, this.getTenantId(), this.isset_tenantId);
|
ub.set(Summary, this.getSummary(), this.isset_summary);
|
ub.set(CreateBy, this.getCreateBy(), this.isset_createBy);
|
ub.set(CreateTime, this.getCreateTime(), this.isset_createTime);
|
ub.set(UpdateBy, this.getUpdateBy(), this.isset_updateBy);
|
ub.set(UpdateTime, this.getUpdateTime(), this.isset_updateTime);
|
ub.set(Lv, this.getLv(), this.isset_lv);
|
ub.set(TempId, this.getTempId(), this.isset_tempId);
|
ub.set(IsDelete, this.getIsDelete(), this.isset_isDelete);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(Name, this.getName(), this.isset_name);
|
ub.set(OrgCode, this.getOrgCode(), this.isset_orgCode);
|
ub.set(OrderNum, this.getOrderNum(), this.isset_orderNum);
|
ub.set(ParentId, this.getParentId(), this.isset_parentId);
|
ub.set(OrgType, this.getOrgType(), this.isset_orgType);
|
ub.set(TenantId, this.getTenantId(), this.isset_tenantId);
|
ub.set(Summary, this.getSummary(), this.isset_summary);
|
ub.set(CreateBy, this.getCreateBy(), this.isset_createBy);
|
ub.set(CreateTime, this.getCreateTime(), this.isset_createTime);
|
ub.set(UpdateBy, this.getUpdateBy(), this.isset_updateBy);
|
ub.set(UpdateTime, this.getUpdateTime(), this.isset_updateTime);
|
ub.set(Lv, this.getLv(), this.isset_lv);
|
ub.set(TempId, this.getTempId(), this.isset_tempId);
|
ub.set(IsDelete, this.getIsDelete(), this.isset_isDelete);
|
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, name, org_code, order_num, parent_id, org_type, tenant_id, summary, create_by, create_time, update_by, update_time, lv, temp_id from "
|
+ this.getTableName_() + " " + where,
|
parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>(
|
"select id, name, org_code, order_num, parent_id, org_type, tenant_id, summary, create_by, create_time, update_by, update_time, lv, temp_id from "
|
+ this.getTableName_() + " " + where,
|
parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public FinSysOrg mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public FinSysOrg toFinSysOrg() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* fin_sys_org RowMapper
|
*
|
* @author genrator
|
*/
|
class FinSysOrgRowMapper implements RowMapper<FinSysOrg> {
|
|
@Override
|
public FinSysOrg mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
FinSysOrg fin_sys_org = new FinSysOrg();
|
Integer columnIndex;
|
// 主键
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.Id);
|
if (columnIndex > 0) {
|
fin_sys_org.setId(rs.getString(columnIndex));
|
}
|
// 普通属性
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.Name);
|
if (columnIndex > 0) {
|
fin_sys_org.setName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.OrgCode);
|
if (columnIndex > 0) {
|
fin_sys_org.setOrgCode(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.OrderNum);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
fin_sys_org.setOrderNum(null);
|
} else {
|
fin_sys_org.setOrderNum(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.ParentId);
|
if (columnIndex > 0) {
|
if (rs.getString(columnIndex) == null) {
|
fin_sys_org.setParentId(null);
|
} else {
|
fin_sys_org.setParentId(rs.getString(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.OrgType);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
fin_sys_org.setOrgType(null);
|
} else {
|
fin_sys_org.setOrgType(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.TenantId);
|
if (columnIndex > 0) {
|
fin_sys_org.setTenantId(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.Summary);
|
if (columnIndex > 0) {
|
fin_sys_org.setSummary(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.CreateBy);
|
if (columnIndex > 0) {
|
fin_sys_org.setCreateBy(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.CreateTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
fin_sys_org.setCreateTime(null);
|
} else {
|
fin_sys_org.setCreateTime(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.UpdateBy);
|
if (columnIndex > 0) {
|
fin_sys_org.setUpdateBy(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.UpdateTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
fin_sys_org.setUpdateTime(null);
|
} else {
|
fin_sys_org.setUpdateTime(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.Lv);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
fin_sys_org.setLv(null);
|
} else {
|
fin_sys_org.setLv(rs.getInt(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.TempId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
fin_sys_org.setTempId(null);
|
} else {
|
fin_sys_org.setTempId(rs.getLong(columnIndex));
|
}
|
}
|
|
columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.IsDelete);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
fin_sys_org.setIsDelete(null);
|
} else {
|
fin_sys_org.setIsDelete(rs.getInt(columnIndex));
|
}
|
}
|
return fin_sys_org;
|
}
|
}
|