consum-base/src/main/java/com/consum/base/controller/FinSysServerController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
consum-base/src/main/java/com/consum/base/pojo/FinSysServerSearchParam.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
consum-base/src/main/java/com/consum/base/pojo/FinSysServerVo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
consum-base/src/main/java/com/consum/base/service/FinSysServerImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
consum-model-pojo/src/main/java/com/consum/model/po/FinSysServer.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
consum-model-pojo/src/main/java/com/consum/model/po/FinSysServer_mapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
consum-base/src/main/java/com/consum/base/controller/FinSysServerController.java
New file @@ -0,0 +1,102 @@ package com.consum.base.controller; import com.consum.base.BaseController; import com.consum.base.pojo.FinSysServerSearchParam; import com.consum.base.pojo.FinSysServerVo; import com.consum.base.service.FinSysServerImpl; import com.consum.model.po.FinSysServer; import com.walker.db.page.GenericPager; import com.walker.db.page.ListPageContext; import com.walker.db.page.PageSearch; import com.walker.infrastructure.utils.DateUtils; import com.walker.infrastructure.utils.NumberGenerator; import com.walker.web.ResponseValue; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/pc/fin/sys/server") public class FinSysServerController extends BaseController { private FinSysServerImpl finSysServerImpl; @Autowired public void setfinSysCategory(FinSysServerImpl finSysServerImpl){ this.finSysServerImpl= finSysServerImpl; } /** * @Description 根据DataScop查询数据信息 * @Author wh * @Date 2023/9/13 9:27 */ @GetMapping("/selectByDataScope") public ResponseValue selectByDataScope(Integer dataScope){ return ResponseValue.success(finSysServerImpl.getByDataScope(dataScope)); } /** * 查询左侧树 * @return */ @GetMapping("/select/tree") public ResponseValue selectFinSysCategoryTree(){ List<FinSysServerVo> finSysCategoryVos = finSysServerImpl.queryAllCategory(); if(finSysCategoryVos!=null){ return ResponseValue.success(finSysCategoryVos); } return ResponseValue.error("未查询到数据!"); } @GetMapping("/select/detail") public ResponseValue selectById(@RequestParam(name = "id") Long Id){ FinSysServer finSysServer = this.finSysServerImpl.get(new FinSysServer(Id)); if (finSysServer == null) return ResponseValue.error("查询失败!"); return ResponseValue.success("查询成功!",finSysServer); } /** * 分页查询 * @param param * @return */ @RequestMapping("/select/list") public ResponseValue finSysServerList(FinSysServerSearchParam param){ PageSearch pageSearch = ListPageContext.getPageSearch(); GenericPager<FinSysServer> pager = this.finSysServerImpl.selectServerListByPage(param); return ResponseValue.success(pager); } /** * 添加 * @param finSysServer * @return */ @PostMapping("/insert") public ResponseValue addFinSysServer(@RequestBody FinSysServer finSysServer){ if(finSysServer==null) return ResponseValue.error("参数为空"); finSysServer.setId(NumberGenerator.getLongSequenceNumber()); finSysServer.setCreatedTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); finSysServer.setCreatedBy(this.getCurrentUser().getUser_name()); finSysServer.setLv(finSysServer.getParentId()+1); int num = this.finSysServerImpl.insert(finSysServer); if(num>0) return ResponseValue.success(1); return ResponseValue.error("插入失败!"); } /** * 编辑 */ @PostMapping("/edit") public ResponseValue editFinSysServer(@RequestBody FinSysServer finSysServer){ if (finSysServer==null) return ResponseValue.error("参数为空"); // if(finSysServer.getLvType()!=null) { // finSysServer.setLv(Long.valueOf(finSysServer.getLvType())); // } int num = this.finSysServerImpl.save(finSysServer); return num>0 ? ResponseValue.success(1):ResponseValue.error("编辑失败!"); } } consum-base/src/main/java/com/consum/base/pojo/FinSysServerSearchParam.java
New file @@ -0,0 +1,24 @@ package com.consum.base.pojo; import com.walker.web.param.ParamRequest; public class FinSysServerSearchParam extends ParamRequest { private Long parentId; private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public Long getParentId() { return parentId; } public void setParentId(Long parentId) { this.parentId = parentId; } } consum-base/src/main/java/com/consum/base/pojo/FinSysServerVo.java
New file @@ -0,0 +1,176 @@ package com.consum.base.pojo; import java.util.List; public class FinSysServerVo { // // 主键 // private Long id = null; // // 属性列表 // // private Long createTime = null; // private Long createdTime = null; // // private String createUser = null; // private String createdBy = null; // private String name = null; // private String code = null; // //private Integer level = null; // private Integer lvType=null; // private Long lv = null; // private Long status = null; // private Long delFlag = null; // private Long parentId = null; // private List<FinSysServerVo> children=null; // // public FinSysServerVo() { // } // // public Long getId() { // return id; // } // // public void setId(Long id) { // this.id = id; // } // // public Long getCreatedTime() { // return createdTime; // } // // public void setCreatedTime(Long createdTime) { // this.createdTime = createdTime; // } // // public String getCreatedBy() { // return createdBy; // } // // public void setCreatedBy(String createdBy) { // this.createdBy = createdBy; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public String getCode() { // return code; // } // // public void setCode(String code) { // this.code = code; // } // // public Integer getLvType() { // return lvType; // } // // public void setLvType(Integer lvType) { // this.lvType = lvType; // } // // public Long getLv() { // return lv; // } // // public void setLv(Long lv) { // this.lv = lv; // } // // public Long getStatus() { // return status; // } // // public void setStatus(Long status) { // this.status = status; // } // // public Long getDelFlag() { // return delFlag; // } // // public void setDelFlag(Long delFlag) { // this.delFlag = delFlag; // } // // public Long getParentId() { // return parentId; // } // // public void setParentId(Long parentId) { // this.parentId = parentId; // } // // public List<FinSysServerVo> getChildren() { // return children; // } // // public void setChildren(List<FinSysServerVo> children) { // this.children = children; // } // // @Override // public String toString() { // return "FinSysCategoryVo{" + // "id=" + id + // ", createdTime=" + createdTime + // ", createdBy='" + createdBy + '\'' + // ", name='" + name + '\'' + // ", code='" + code + '\'' + // ", lvType=" + lvType + // ", lv=" + lv + // ", status=" + status + // ", delFlag=" + delFlag + // ", parentId=" + parentId + // ", children=" + children + // '}'; // } private Long id; private String label; private Long parentId; private List<FinSysServerVo> children; public FinSysServerVo(Long id, String label, Long parentId, List<FinSysServerVo> children) { this.id = id; this.label = label; this.parentId = parentId; this.children = children; } public FinSysServerVo() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public Long getParentId() { return parentId; } public void setParentId(Long parentId) { this.parentId = parentId; } public List<FinSysServerVo> getChildren() { return children; } public void setChildren(List<FinSysServerVo> children) { this.children = children; } } consum-base/src/main/java/com/consum/base/service/FinSysServerImpl.java
New file @@ -0,0 +1,96 @@ package com.consum.base.service; import com.consum.base.pojo.FinSysServerSearchParam; import com.consum.base.pojo.FinSysServerVo; import com.consum.model.po.FinSysServer; import com.iplatform.model.po.S_role; import com.walker.db.page.GenericPager; import com.walker.jdbc.service.BaseServiceImpl; import com.walker.jdbc.util.StringUtils; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @Service public class FinSysServerImpl extends BaseServiceImpl { private static final String SELECT_TREE_ALL = "select * from FIN_SYS_SERVER"; private static final String SELECT_CHILD_BY_ID = "select * from FIN_SYS_SERVER where 1=1"; // private static final String S /** * 查询所有服务目录 * * @return * @date 2023-07-11 */ public List<FinSysServerVo> queryAllCategory() { List<FinSysServer> finSysCategories = this.select(SELECT_TREE_ALL, new Object[] {}, new FinSysServer()); List<FinSysServerVo> result = null; if (finSysCategories != null) { List<FinSysServerVo> finSysCategoryVos = finSysCategories.stream().map(category -> { FinSysServerVo finSysCategoryVo = new FinSysServerVo(); // BeanUtils.copyProperties(category, finSysCategoryVo); finSysCategoryVo.setId(category.getId()); finSysCategoryVo.setLabel(category.getName()); finSysCategoryVo.setParentId(category.getParentId()); return finSysCategoryVo; }).collect(Collectors.toList()); result = finSysCategoryVos.stream().filter(c -> c.getParentId() == 0).map(tree -> { tree.setChildren(getChildren(tree, finSysCategoryVos)); return tree; }).collect(Collectors.toList()); } return result; } private List<FinSysServerVo> getChildren(FinSysServerVo tree, List<FinSysServerVo> finSysCategoryVos) { return finSysCategoryVos.stream().filter(c -> c.getParentId() == tree.getId()).map(m -> { m.setChildren(getChildren(m, finSysCategoryVos)); return m; }).collect(Collectors.toList()); } /** * 根据id查询当下菜单所属子菜单 */ public List<FinSysServer> findChildById(Long parentId) { List<FinSysServer> children = this.select(SELECT_CHILD_BY_ID, new Object[] {parentId}, new FinSysServer()); return children; } /** * 分页查询 * * @param param * @return */ public GenericPager<FinSysServer> selectServerListByPage(FinSysServerSearchParam param) { Map<String, Object> parameter = new HashMap(); StringBuilder sql = new StringBuilder(SELECT_CHILD_BY_ID); if (param.getName() != null && StringUtils.isNotEmpty(param.getName())) { sql.append(" and NAME like :name"); parameter.put("name", StringUtils.CHAR_PERCENT + param.getName() + StringUtils.CHAR_PERCENT); } if (param.getParentId() != null) { sql.append(" and PARENT_ID = :parentId"); parameter.put("parentId", param.getParentId()); } return this.selectSplit(sql.toString(), parameter, new FinSysServer()); } /** * @Description 根据DataScope查询信息 * @Author wh * @Date 2023/9/13 9:35 */ public List<S_role> getByDataScope(Integer dataScope) { Map<String, Object> parameter = new HashMap(); String sql = "SELECT * FROM S_ROLE sr WHERE status=0 and DATA_SCOPE = :dataScope"; parameter.put("dataScope", dataScope); return this.select(sql.toString(), parameter, new S_role()); } } consum-model-pojo/src/main/java/com/consum/model/po/FinSysServer.java
New file @@ -0,0 +1,304 @@ package com.consum.model.po; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnore; import com.walker.jdbc.BasePo; /** * 表名:FIN_SYS_SERVER * * @author genrator */ @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) public class FinSysServer extends BasePo<FinSysServer> { // 序列化版本号 private static final long serialVersionUID = 1L; // 主键 private Long id = null; @JsonIgnore protected boolean isset_id = false; // 属性列表 private Long parentId = null; @JsonIgnore protected boolean isset_parentId = false; private String name = null; @JsonIgnore protected boolean isset_name = false; private String code = null; @JsonIgnore protected boolean isset_code = false; private Integer lvType = null; @JsonIgnore protected boolean isset_lvType = false; private Long lv = null; @JsonIgnore protected boolean isset_lv = false; private Long status = null; @JsonIgnore protected boolean isset_status = false; private Long delFlag = null; @JsonIgnore protected boolean isset_delFlag = false; private String createdBy = null; @JsonIgnore protected boolean isset_createdBy = false; private Long createdTime = null; @JsonIgnore protected boolean isset_createdTime = false; private String description = null; @JsonIgnore protected boolean isset_description = false; /** * 默认构造函数 */ public FinSysServer() { } /** * 根据主键构造对象 */ public FinSysServer(Long id) { this.setId(id); } /** * 设置主键值 */ @Override public void setPkValue(Object value) { this.setId((Long) value); } public Long getId() { return this.id; } public void setId(Long id) { this.id = id; this.isset_id = true; } @JsonIgnore public boolean isEmptyId() { return this.id == null; } public Long getParentId() { return this.parentId; } public void setParentId(Long parentId) { this.parentId = parentId; this.isset_parentId = true; } @JsonIgnore public boolean isEmptyParentId() { return this.parentId == null; } public String getName() { return this.name; } public void setName(String name) { this.name = name; this.isset_name = true; } @JsonIgnore public boolean isEmptyName() { return this.name == null || this.name.length() == 0; } public String getCode() { return this.code; } public void setCode(String code) { this.code = code; this.isset_code = true; } @JsonIgnore public boolean isEmptyCode() { return this.code == null || this.code.length() == 0; } public Integer getLvType() { return this.lvType; } public void setLvType(Integer lvType) { this.lvType = lvType; this.isset_lvType = true; } @JsonIgnore public boolean isEmptyLvType() { return this.lvType == null; } public Long getLv() { return this.lv; } public void setLv(Long lv) { this.lv = lv; this.isset_lv = true; } @JsonIgnore public boolean isEmptyLv() { return this.lv == null; } public Long getStatus() { return this.status; } public void setStatus(Long status) { this.status = status; this.isset_status = true; } @JsonIgnore public boolean isEmptyStatus() { return this.status == null; } public Long getDelFlag() { return this.delFlag; } public void setDelFlag(Long delFlag) { this.delFlag = delFlag; this.isset_delFlag = true; } @JsonIgnore public boolean isEmptyDelFlag() { return this.delFlag == null; } public String getCreatedBy() { return this.createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; this.isset_createdBy = true; } @JsonIgnore public boolean isEmptyCreatedBy() { return this.createdBy == null || this.createdBy.length() == 0; } public Long getCreatedTime() { return this.createdTime; } public void setCreatedTime(Long createdTime) { this.createdTime = createdTime; this.isset_createdTime = true; } @JsonIgnore public boolean isEmptyCreatedTime() { return this.createdTime == null; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; this.isset_description = true; } @JsonIgnore public boolean isEmptyDescription() { return this.description == null || this.description.length() == 0; } /** * 重写 toString() 方法 */ @Override public String toString() { return new StringBuilder() .append("id=").append(this.id) .append("parentId=").append(this.parentId) .append("name=").append(this.name) .append("code=").append(this.code) .append("lvType=").append(this.lvType) .append("lv=").append(this.lv) .append("status=").append(this.status) .append("delFlag=").append(this.delFlag) .append("createdBy=").append(this.createdBy) .append("createdTime=").append(this.createdTime) .append("description=").append(this.description) .toString(); } /** * 克隆 */ public FinSysServer $clone() { FinSysServer fin_sys_server = new FinSysServer(); // 数据库名称 //fin_sys_server.setDatabaseName_(this.getDatabaseName_()); // 主键 if (this.isset_id) { fin_sys_server.setId(this.getId()); } // 普通属性 if (this.isset_parentId) { fin_sys_server.setParentId(this.getParentId()); } if (this.isset_name) { fin_sys_server.setName(this.getName()); } if (this.isset_code) { fin_sys_server.setCode(this.getCode()); } if (this.isset_lvType) { fin_sys_server.setLvType(this.getLvType()); } if (this.isset_lv) { fin_sys_server.setLv(this.getLv()); } if (this.isset_status) { fin_sys_server.setStatus(this.getStatus()); } if (this.isset_delFlag) { fin_sys_server.setDelFlag(this.getDelFlag()); } if (this.isset_createdBy) { fin_sys_server.setCreatedBy(this.getCreatedBy()); } if (this.isset_createdTime) { fin_sys_server.setCreatedTime(this.getCreatedTime()); } if (this.isset_description) { fin_sys_server.setDescription(this.getDescription()); } return fin_sys_server; } } consum-model-pojo/src/main/java/com/consum/model/po/FinSysServer_mapper.java
New file @@ -0,0 +1,351 @@ 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_SERVER * * @author genrator */ public class FinSysServer_mapper extends FinSysServer implements BaseMapper<FinSysServer> { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper<FinSysServer> ROW_MAPPER = new FinSysServerRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String ParentId = "parent_id"; public static final String Name = "name"; public static final String Code = "code"; public static final String LvType = "lv_type"; public static final String Lv = "lv"; public static final String Status = "status"; public static final String DelFlag = "del_flag"; public static final String CreatedBy = "created_by"; public static final String CreatedTime = "created_time"; public static final String Description = "description"; /** * 默认构造函数 */ public FinSysServer_mapper(FinSysServer finSysServer) { if (finSysServer == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (finSysServer.isset_id) { this.setId(finSysServer.getId()); } //普通属性 if (finSysServer.isset_parentId) { this.setParentId(finSysServer.getParentId()); } if (finSysServer.isset_name) { this.setName(finSysServer.getName()); } if (finSysServer.isset_code) { this.setCode(finSysServer.getCode()); } if (finSysServer.isset_lvType) { this.setLvType(finSysServer.getLvType()); } if (finSysServer.isset_lv) { this.setLv(finSysServer.getLv()); } if (finSysServer.isset_status) { this.setStatus(finSysServer.getStatus()); } if (finSysServer.isset_delFlag) { this.setDelFlag(finSysServer.getDelFlag()); } if (finSysServer.isset_createdBy) { this.setCreatedBy(finSysServer.getCreatedBy()); } if (finSysServer.isset_createdTime) { this.setCreatedTime(finSysServer.getCreatedTime()); } if (finSysServer.isset_description) { this.setDescription(finSysServer.getDescription()); } // 去掉,2022-09-07 // this.setDatabaseName_(fin_sys_server.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "fin_sys_server"; /** 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(ParentId, this.getParentId(), this.isset_parentId); ib.set(Name, this.getName(), this.isset_name); ib.set(Code, this.getCode(), this.isset_code); ib.set(LvType, this.getLvType(), this.isset_lvType); ib.set(Lv, this.getLv(), this.isset_lv); ib.set(Status, this.getStatus(), this.isset_status); ib.set(DelFlag, this.getDelFlag(), this.isset_delFlag); ib.set(CreatedBy, this.getCreatedBy(), this.isset_createdBy); ib.set(CreatedTime, this.getCreatedTime(), this.isset_createdTime); ib.set(Description, this.getDescription(), this.isset_description); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters<Map<String, Object>> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(ParentId, this.getParentId(), this.isset_parentId); ub.set(Name, this.getName(), this.isset_name); ub.set(Code, this.getCode(), this.isset_code); ub.set(LvType, this.getLvType(), this.isset_lvType); ub.set(Lv, this.getLv(), this.isset_lv); ub.set(Status, this.getStatus(), this.isset_status); ub.set(DelFlag, this.getDelFlag(), this.isset_delFlag); ub.set(CreatedBy, this.getCreatedBy(), this.isset_createdBy); ub.set(CreatedTime, this.getCreatedTime(), this.isset_createdTime); ub.set(Description, this.getDescription(), this.isset_description); 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(ParentId, this.getParentId(), this.isset_parentId); ub.set(Name, this.getName(), this.isset_name); ub.set(Code, this.getCode(), this.isset_code); ub.set(LvType, this.getLvType(), this.isset_lvType); ub.set(Lv, this.getLv(), this.isset_lv); ub.set(Status, this.getStatus(), this.isset_status); ub.set(DelFlag, this.getDelFlag(), this.isset_delFlag); ub.set(CreatedBy, this.getCreatedBy(), this.isset_createdBy); ub.set(CreatedTime, this.getCreatedTime(), this.isset_createdTime); ub.set(Description, this.getDescription(), this.isset_description); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(ParentId, this.getParentId(), this.isset_parentId); ub.set(Name, this.getName(), this.isset_name); ub.set(Code, this.getCode(), this.isset_code); ub.set(LvType, this.getLvType(), this.isset_lvType); ub.set(Lv, this.getLv(), this.isset_lv); ub.set(Status, this.getStatus(), this.isset_status); ub.set(DelFlag, this.getDelFlag(), this.isset_delFlag); ub.set(CreatedBy, this.getCreatedBy(), this.isset_createdBy); ub.set(CreatedTime, this.getCreatedTime(), this.isset_createdTime); ub.set(Description, this.getDescription(), this.isset_description); 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, parent_id, name, code, lv_type, lv, status, del_flag, created_by, created_time, description from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, parent_id, name, code, lv_type, lv, status, del_flag, created_by, created_time, description from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public FinSysServer mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public FinSysServer toFinSysServer() { return super.$clone(); } } /** * fin_sys_server RowMapper * * @author genrator */ class FinSysServerRowMapper implements RowMapper<FinSysServer> { @Override public FinSysServer mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); FinSysServer fin_sys_server = new FinSysServer(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.Id); if (columnIndex > 0) { fin_sys_server.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.ParentId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { fin_sys_server.setParentId(null); } else { fin_sys_server.setParentId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.Name); if (columnIndex > 0) { fin_sys_server.setName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.Code); if (columnIndex > 0) { fin_sys_server.setCode(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.LvType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { fin_sys_server.setLvType(null); } else { fin_sys_server.setLvType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.Lv); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { fin_sys_server.setLv(null); } else { fin_sys_server.setLv(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.Status); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { fin_sys_server.setStatus(null); } else { fin_sys_server.setStatus(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.DelFlag); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { fin_sys_server.setDelFlag(null); } else { fin_sys_server.setDelFlag(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.CreatedBy); if (columnIndex > 0) { fin_sys_server.setCreatedBy(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.CreatedTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { fin_sys_server.setCreatedTime(null); } else { fin_sys_server.setCreatedTime(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, FinSysServer_mapper.Description); if (columnIndex > 0) { fin_sys_server.setDescription(rs.getString(columnIndex)); } return fin_sys_server; } }