已重命名4个文件
已添加1个文件
已修改2个文件
已删除1个文件
| | |
| | | import com.moon.server.entity.sys.ResEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.data.LayerService; |
| | | import com.moon.server.service.sys.LayerService; |
| | | import com.moon.server.service.sys.MenuService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import com.moon.server.entity.all.*; |
ÎļþÃû´Ó src/main/java/com/moon/server/controller/data/LayerController.java ÐÞ¸Ä |
| | |
| | | package com.moon.server.controller.data; |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.data.LayerEntity; |
| | | import com.moon.server.entity.sys.LayerEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.data.LayerService; |
| | | import com.moon.server.service.sys.LayerService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å¾å±ç®¡ç |
| | | * å¾å± |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\å¾å±ç®¡ç") |
| | | @Api(tags = "è¿ç»´ç®¡ç\\å¾å±ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/layer") |
| | | public class LayerController extends BaseController { |
| | |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "cnName", value = "䏿åç§°", dataType = "String", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String cnName) { |
| | | try { |
| | | int count = layerService.selectCount(cnName); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "cnName", value = "䏿åç§°", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<LayerEntity>> selectByPage(String cnName, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<LayerEntity> rs = layerService.selectByPage(cnName, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "cnName", value = "䏿åç§°", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<LayerEntity>> selectByPageAndCount(String cnName, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<LayerEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = layerService.selectCount(cnName); |
| | | int count = layerService.selectCount(name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<LayerEntity> rs = layerService.selectByPage(cnName, pageSize, pageSize * (pageIndex - 1)); |
| | | List<LayerEntity> rs = layerService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
ÎļþÃû´Ó src/main/java/com/moon/server/entity/data/LayerEntity.java ÐÞ¸Ä |
| | |
| | | package com.moon.server.entity.data; |
| | | package com.moon.server.entity.sys; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | |
| | | * @author WWW |
| | | */ |
| | | public class LayerEntity implements Serializable { |
| | | private static final long serialVersionUID = -159911666139919168L; |
| | | private static final long serialVersionUID = -371902381708800000L; |
| | | |
| | | private int id; |
| | | |
| | |
| | | |
| | | private String url; |
| | | |
| | | private String testUrl; |
| | | |
| | | private int type; |
| | | private int isLayer; |
| | | |
| | | private String icon; |
| | | |
| | |
| | | |
| | | private int orderNum; |
| | | |
| | | private int isShow; |
| | | private int status; |
| | | |
| | | private int createUser; |
| | | |
| | |
| | | |
| | | private String bak; |
| | | |
| | | private String serveType; |
| | | |
| | | private String dataType; |
| | | |
| | | private double elev; |
| | | |
| | | private String ns; |
| | | private int resid; |
| | | |
| | | private Integer pubid; |
| | | |
| | | private Integer isProject; |
| | | private int type; |
| | | |
| | | public LayerEntity() { |
| | | } |
| | |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getTestUrl() { |
| | | return testUrl; |
| | | public int getIsLayer() { |
| | | return isLayer; |
| | | } |
| | | |
| | | public void setTestUrl(String testUrl) { |
| | | this.testUrl = testUrl; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | public void setIsLayer(int isLayer) { |
| | | this.isLayer = isLayer; |
| | | } |
| | | |
| | | public String getIcon() { |
| | |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public int getIsShow() { |
| | | return isShow; |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setIsShow(int isShow) { |
| | | this.isShow = isShow; |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getServeType() { |
| | | return serveType; |
| | | } |
| | | |
| | | public void setServeType(String serveType) { |
| | | this.serveType = serveType; |
| | | } |
| | | |
| | | public String getDataType() { |
| | | return dataType; |
| | | } |
| | | |
| | | public void setDataType(String dataType) { |
| | | this.dataType = dataType; |
| | | } |
| | | |
| | | public double getElev() { |
| | | return elev; |
| | | } |
| | |
| | | this.elev = elev; |
| | | } |
| | | |
| | | public String getNs() { |
| | | return ns; |
| | | public int getResid() { |
| | | return resid; |
| | | } |
| | | |
| | | public void setNs(String ns) { |
| | | this.ns = ns; |
| | | public void setResid(int resid) { |
| | | this.resid = resid; |
| | | } |
| | | |
| | | public Integer getPubid() { |
| | | return pubid; |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setPubid(Integer pubid) { |
| | | this.pubid = pubid; |
| | | } |
| | | |
| | | public Integer getIsProject() { |
| | | return isProject; |
| | | } |
| | | |
| | | public void setIsProject(Integer isProject) { |
| | | this.isProject = isProject; |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | } |
ÎļþÃû´Ó src/main/java/com/moon/server/mapper/data/LayerMapper.java ÐÞ¸Ä |
| | |
| | | package com.moon.server.mapper.data; |
| | | package com.moon.server.mapper.sys; |
| | | |
| | | import com.moon.server.entity.data.LayerEntity; |
| | | import com.moon.server.entity.sys.LayerEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | /** |
| | | * æ¥è¯¢è®°å½æ° |
| | | * |
| | | * @param cnName 䏿åç§° |
| | | * @param name åç§° |
| | | * @return è®°å½æ° |
| | | */ |
| | | public Integer selectCount(String cnName); |
| | | public Integer selectCount(String name); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param cnName 䏿åç§° |
| | | * @param name åç§° |
| | | * @param limit è®°å½æ° |
| | | * @param offset åç§»é |
| | | * @return å表 |
| | | */ |
| | | public List<LayerEntity> selectByPage(String cnName, Integer limit, Integer offset); |
| | | public List<LayerEntity> selectByPage(String name, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ |
ÎļþÃû´Ó src/main/java/com/moon/server/service/data/LayerService.java ÐÞ¸Ä |
| | |
| | | package com.moon.server.service.data; |
| | | package com.moon.server.service.sys; |
| | | |
| | | import com.moon.server.entity.data.LayerEntity; |
| | | import com.moon.server.entity.sys.LayerEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.mapper.data.LayerMapper; |
| | | import com.moon.server.mapper.sys.LayerMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | LayerMapper layerMapper; |
| | | |
| | | @Override |
| | | public Integer selectCount(String cnName) { |
| | | cnName = StringHelper.getLikeUpperStr(cnName); |
| | | public Integer selectCount(String name) { |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return layerMapper.selectCount(cnName); |
| | | return layerMapper.selectCount(name); |
| | | } |
| | | |
| | | @Override |
| | | public List<LayerEntity> selectByPage(String cnName, Integer limit, Integer offset) { |
| | | cnName = StringHelper.getLikeUpperStr(cnName); |
| | | public List<LayerEntity> selectByPage(String name, Integer limit, Integer offset) { |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return layerMapper.selectByPage(cnName, limit, offset); |
| | | return layerMapper.selectByPage(name, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | |
| | | # redis |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | host: 192.168.20.83 |
| | | port: 6369 |
| | | password: rediS_5L#F4_Server |
| | | timeout: 10000 # è¿æ¥è¶
æ¶æ¶é¿ï¼æ¯«ç§ï¼ |
| | | timeout: 90000 # è¿æ¥è¶
æ¶æ¶é¿ï¼æ¯«ç§ï¼ |
| | | lettuce: |
| | | pool: |
| | | max-active: 1000 # è¿æ¥æ± æå¤§è¿æ¥æ°ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | |
| | | datasource: |
| | | name: prod |
| | | # JDBC åºæ¬é
ç½® ¤tSchema=public |
| | | #url: jdbc:postgresql://192.168.20.83:5433/moon?useAffectedRows=true |
| | | url: jdbc:postgresql://127.0.0.1:5433/moon?useAffectedRows=true |
| | | url: jdbc:postgresql://192.168.20.83:5433/moon?useAffectedRows=true |
| | | #url: jdbc:postgresql://127.0.0.1:5433/moon?useAffectedRows=true |
| | | username : postgres |
| | | #password: Postgres!_14_moon |
| | | password: postgres |
| | | password: Postgres!_14_moon |
| | | #password: postgres |
| | | driver-class-name: org.postgresql.Driver |
| | | platform: POSTGRESQL |
| | | type: com.alibaba.druid.pool.DruidDataSource |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.moon.server.mapper.sys.LayerMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_layer |
| | | <where> |
| | | <if test="name != null"> |
| | | upper(cn_name) like #{name} or upper(en_name) like #{name} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.moon.server.entity.sys.LayerEntity"> |
| | | select * from lf.sys_layer |
| | | <where> |
| | | <if test="name != null"> |
| | | upper(cn_name) like #{name} or upper(en_name) like #{name} |
| | | </if> |
| | | </where> |
| | | order by id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.moon.server.entity.sys.LayerEntity"> |
| | | select * from lf.sys_layer order by id desc; |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.moon.server.entity.sys.LayerEntity"> |
| | | select * from lf.sys_layer where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.moon.server.entity.sys.LayerEntity"> |
| | | insert into lf.sys_layer |
| | | (pid,cn_name,en_name,url,is_layer,icon,level,order_num,status,create_user,create_time,bak,elev,resid,type) |
| | | values |
| | | (#{pid},#{cnName},#{enName},#{url},#{isLayer},#{icon},#{level},#{orderNum},#{status},#{createUser},now(),#{bak},#{elev},#{resid},#{type}) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_layer |
| | | (pid,cn_name,en_name,url,is_layer,icon,level,order_num,status,create_user,create_time,bak,elev,resid,type) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.pid},#{item.cnName},#{item.enName},#{item.url},#{item.isLayer},#{item.icon},#{item.level},#{item.orderNum},#{item.status},#{item.createUser},now(),#{item.bak},#{item.elev},#{item.resid},#{item.type}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="delete"> |
| | | delete from lf.sys_layer where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deletes"> |
| | | delete from lf.sys_layer where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="update"> |
| | | update lf.sys_layer |
| | | set pid=#{pid},cn_name=#{cnName},en_name=#{enName},url=#{url},is_layer=#{isLayer},icon=#{icon},level=#{level},order_num=#{orderNum},status=#{status},update_user=#{updateUser},update_time=now(),bak=#{bak},elev=#{elev},resid=#{resid},type=#{type} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_layer |
| | | set pid=#{item.pid},cn_name=#{item.cnName},en_name=#{item.enName},url=#{item.url},is_layer=#{item.isLayer},icon=#{item.icon},level=#{item.level},order_num=#{item.orderNum},status=#{item.status},update_user=#{item.updateUser},update_time=now(),bak=#{item.bak},elev=#{item.elev},resid=#{item.resid},type=#{item.type} |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |