| | |
| | | ----------------------------------------------------------------------------------------------------- 1.æ¥è¯¢è¿æ¥æ° |
| | | ----------------------------------------------------------------------------------------------------- 0.æ¥è¯¢è¿æ¥æ° |
| | | show max_connections; |
| | | select count(1) from pg_stat_activity; |
| | | |
| | |
| | | select fn_rec_array(1, 'dep'); |
| | | select fn_rec_array(10, 'dir'); |
| | | select * from lf.sys_user a where a.depid=ANY(fn_rec_array(15,'dep')); |
| | | ----------------------------------------------------------------------------------------------------- g.ç´¢å¼ |
| | | ----------------------------------------------------------------------------------------------------- g.è·åå®ä½å |
| | | create or replace function fn_get_entity(tab varchar) |
| | | returns varchar as $$ |
| | | declare |
| | | str varchar; |
| | | rs varchar = ''; |
| | | begin |
| | | foreach str in array (select string_to_array(tab, '_')) loop |
| | | if (length(rs) = 0 or length(str) = 1) then |
| | | rs = rs || str; |
| | | else |
| | | rs = rs || initcap(str); |
| | | end if; |
| | | end loop; |
| | | |
| | | return rs; |
| | | end; |
| | | $$ language plpgsql; |
| | | |
| | | select fn_get_entity('dlg_25w_boua_s'); select fn_get_entity('dlg_25w_vega'); |
| | | ----------------------------------------------------------------------------------------------------- h.ç´¢å¼ |
| | | alter table lf.sys_role_user add constraint idx_unique_role_user unique (roleid, userid); -- èåå¯ä¸ç´¢å¼ |
| | | insert into lf.sys_role_user (roleid,userid) values (1,1); -- æµè¯ |
| | | select * from lf.sys_role_user; |
| | |
| | | alter table lf.sys_role_menu_auth add constraint idx_unique_role_menu_auth unique (roleid,menu_auth_id); -- èåå¯ä¸ç´¢å¼ |
| | | insert into lf.sys_role_menu_auth (roleid,menu_auth_id) values (1,1); |
| | | select * from lf.sys_role_menu_auth; |
| | | ----------------------------------------------------------------------------------------------------- |
| | | ----------------------------------------------------------------------------------------------------- i.èåæ¥è¯¢ |
| | | select a.*,fn_uname(a.create_user) createUserName,fn_uname(a.update_user) updateUserName from lf.sys_blacklist a order by a.id; |
| | | select * from lf.sys_user a where uname like '%' and a.depid=ANY(fn_rec_array(1,'dep')); |
| | | select * from lf.sys_user a left join lf.sys_role_user b on a.id=b.userid |
| | |
| | | update lf.sys_operate set modular1='è¿ç»´ç®¡ç',modular2='èµæºç®¡ç' where position('/res/select' in url)>0 and (modular1 is null or modular2 is null); |
| | | |
| | | delete from lf.sys_operate where modular1 is null or modular2 is null; |
| | | ----------------------------------------------------------------------------------------------------- |
| | | ----------------------------------------------------------------------------------------------------- j.æ¥è¯¢ææ |
| | | select gid,gb,name,st_astext(a.geom) from bd.dlg_agnp a; |
| | | |
| | | -- æ ¹æ®ç¨æ·Uidæ¥è¯¢èµæº |
| | |
| | | inner join lf.sys_menu e on d.menuid = e.id |
| | | inner join lf.sys_auth f on d.authid = f.id |
| | | where a.uid = 'admin'; |
| | | ---------------------------------------------------------------------------------------------- æ°æ®ç»è®¡ |
| | | ---------------------------------------------------------------------------------------------- k.æ°æ®ç»è®¡ |
| | | select modular2,count(*) from lf.sys_operate group by modular2; |
| | | |
| | | select to_char(optime,'yyyy-mm-dd') as optime,count(*) from lf.sys_login where optime between (select optime - interval '30 day') |
| | |
| | | and ST_Intersects(geom, |
| | | ST_PolygonFromText('POLYGON ((115.94927385452 32.3754479115071 0,121.989371092554 32.2766788010181 0,121.850621222894 29.6874200067864 0,115.9727267226 29.7835368627922 0,115.94927385452 32.3754479115071 0))', 4326)) |
| | | |
| | | select st_astext(geom) from bd.dlg_25w_hfcl limit 10; |
| | | |
| | | select * from lf.sys_attach where 1=1 limit 1 |
| | | select * from lf.sys_download; |
| | | select * from lf.sys_user; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | create_time timestamp(6) without time zone default now(), |
| | | update_user integer, |
| | | update_time timestamp(6) without time zone, |
| | | tabletype varchar(20), |
| | | unit varchar(50), |
| | | domain_na varchar(100), |
| | | showtype smallint, |
| | | editable smallint, |
| | | bak varchar(1024) |
| | | ); |
| | | comment on table lf.sys_dict is 'é件表'; |
| | |
| | | comment on column lf.sys_dict.create_time is 'å建æ¶é´'; |
| | | comment on column lf.sys_dict.update_user is 'æ´æ°äººID'; |
| | | comment on column lf.sys_dict.update_time is 'æ´æ°æ¶é´'; |
| | | comment on column lf.sys_dict.tabletype is '表类å'; |
| | | comment on column lf.sys_dict.unit is 'åä½'; |
| | | comment on column lf.sys_dict.domain_na is 'å¼ååç§°'; |
| | | comment on column lf.sys_dict.showtype is 'æ¾ç¤ºç±»å'; |
| | | comment on column lf.sys_dict.editable is 'æ¯å¦å¯ç¼è¾'; |
| | | comment on column lf.sys_dict.bak is '夿³¨'; |
| | | /* alter sequence lf.sys_dict_id_seq restart with 300; |
| | | update lf.sys_dict set create_user=1,create_time=now() where 1=1; |
| | |
| | | |
| | | select count(*) from lf.sys_dict where tab='sys_user'; |
| | | select * from lf.sys_dict order by ns,tab,order_num limit 10 offset 0; |
| | | select distinct ns,fn_get_entity(tab) tab,tab_desc,tabletype from lf.sys_dict order by tab; |
| | | ----------------------------------------------------------------------------------------------------- 21.æ ·å¼è¡¨ |
| | | -- DROP TABLE IF EXISTS lf.sys_style; |
| | | create table lf.sys_style( |
| | |
| | | import com.lf.server.aspect.SysLog; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.ctrl.IdNameEntity; |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import com.lf.server.helper.AesHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.all.BasicMapper; |
| | |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææè¡¨") |
| | | @GetMapping(value = "/selectTabs") |
| | | public ResponseMsg<List<DictEntity>> selectTabs() { |
| | | try { |
| | | List<DictEntity> list = baseQueryService.selectTabs(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author SWS + WWW |
| | | * @date 2022-09.26 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\åå
¸ç®¡ç") |
| | | @RestController |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", required = false, example = "") |
| | | @ApiImplicitParam(name = "ns", value = "表空é´", dataType = "String", paramType = "query", required = false, example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg_25w_hyda") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String tab) { |
| | | public ResponseMsg<Integer> selectCount(String ns, String tab) { |
| | | try { |
| | | int count = dictService.selectCount(tab); |
| | | int count = dictService.selectCount(ns, tab); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "ns", value = "表空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg_25w_hyda"), |
| | | @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<DictEntity>> selectByPage(String tab, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<DictEntity>> selectByPage(String ns, String tab, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<DictEntity> rs = dictService.selectByPage(tab, pageSize, pageSize * (pageIndex - 1)); |
| | | List<DictEntity> rs = dictService.selectByPage(ns, tab, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "ns", value = "表空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg_25w_hyda"), |
| | | @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<DictEntity>> selectByPageAndCount(String tab, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<DictEntity>> selectByPageAndCount(String ns, String tab, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = dictService.selectCount(tab); |
| | | int count = dictService.selectCount(ns, tab); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<DictEntity> rs = dictService.selectByPage(tab, pageSize, pageSize * (pageIndex - 1)); |
| | | List<DictEntity> rs = dictService.selectByPage(ns, tab, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<DictEntity>> selectAll() { |
| | | try { |
| | | List<DictEntity> list = dictService.selectAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<DictEntity> selectById(int id) { |
| | | try { |
| | | DictEntity entity = dictService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.data.DictEntity", paramType = "body", example = "") |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "DictEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insertDict", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertDict(@RequestBody DictEntity entity, HttpServletRequest req) { |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody DictEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = dictService.insertDict(entity); |
| | | int count = dictService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<DictEntity>", paramType = "body", example = "") |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "DictEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insertDicts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertDicts(@RequestBody List<DictEntity> list, HttpServletRequest req) { |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<DictEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | |
| | | } |
| | | } |
| | | |
| | | int count = dictService.insertDicts(list); |
| | | int count = dictService.inserts(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/deleteDict") |
| | | public ResponseMsg<Integer> deleteDict(int id) { |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | int count = dictService.deleteDict(id); |
| | | int count = dictService.delete(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteDicts") |
| | | public ResponseMsg<Integer> deleteDicts(@RequestParam List<Integer> ids) { |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = dictService.deleteDicts(ids); |
| | | int count = dictService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "DictEntity", paramType = "body", example = "") |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "DictEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateDict", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateDict(@RequestBody DictEntity entity, HttpServletRequest req) { |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody DictEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | { |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = dictService.updateDict(entity); |
| | | int count = dictService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "DictEntity", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/selectDict") |
| | | public ResponseMsg<DictEntity> selectDict(int id) { |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<DictEntity> list, HttpServletRequest req) { |
| | | try { |
| | | DictEntity de = dictService.selectDict(id); |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (DictEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | return success(de); |
| | | int count = dictService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectDictAll") |
| | | public ResponseMsg<List<DictEntity>> selectDictAll() { |
| | | try { |
| | | List<DictEntity> list = dictService.selectDictAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢åå
¸ä¸çææè¡¨å") |
| | | @GetMapping(value = "/selectDictTab") |
| | | public ResponseMsg<List<DictEntity>> selectDictTab() { |
| | | try { |
| | | List<DictEntity> list = dictService.selectDictTab(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | * @author WWW |
| | | */ |
| | | |
| | | public class DictEntity implements Serializable { |
| | | private static final long serialVersionUID = -343890141066128689L; |
| | | |
| | |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String tabletype; |
| | | |
| | | private String unit; |
| | | |
| | | private String domainNa; |
| | | |
| | | private int showtype; |
| | | |
| | | private int editable; |
| | | |
| | | private String bak; |
| | | |
| | | public DictEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getTabletype() { |
| | | return tabletype; |
| | | } |
| | | |
| | | public void setTabletype(String tabletype) { |
| | | this.tabletype = tabletype; |
| | | } |
| | | |
| | | public String getUnit() { |
| | | return unit; |
| | | } |
| | | |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | |
| | | public String getDomainNa() { |
| | | return domainNa; |
| | | } |
| | | |
| | | public void setDomainNa(String domainNa) { |
| | | this.domainNa = domainNa; |
| | | } |
| | | |
| | | public int getShowtype() { |
| | | return showtype; |
| | | } |
| | | |
| | | public void setShowtype(int showtype) { |
| | | this.showtype = showtype; |
| | | } |
| | | |
| | | public int getEditable() { |
| | | return editable; |
| | | } |
| | | |
| | | public void setEditable(int editable) { |
| | | this.editable = editable; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | |
| | | package com.lf.server.mapper.all; |
| | | |
| | | import com.lf.server.entity.ctrl.IdNameEntity; |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | * @return å®ä½ç±»éå |
| | | */ |
| | | public List<IdNameEntity> selectDepFuzzy(String name); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææè¡¨ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<DictEntity> selectTabs(); |
| | | } |
| | |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | * @author WWW |
| | | */ |
| | | @Mapper |
| | | @Repository |
| | |
| | | /** |
| | | * æ¥è¯¢è®°å½æ° |
| | | * |
| | | * @param ns è¡¨ç©ºé´ |
| | | * @param tab 表å |
| | | * @return è®°å½æ° |
| | | */ |
| | | public Integer selectCount(String tab); |
| | | public Integer selectCount(String ns, String tab); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param ns è¡¨ç©ºé´ |
| | | * @param tab 表å |
| | | * @param limit è®°å½è¡¨ |
| | | * @param offset åç§»é |
| | | * @return å表 |
| | | */ |
| | | public List<DictEntity> selectByPage(String tab, Integer limit, Integer offset); |
| | | public List<DictEntity> selectByPage(String ns, String tab, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<DictEntity> selectAll(); |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public DictEntity selectById(int id); |
| | | |
| | | /** |
| | | * æå
¥ä¸æ¡ |
| | | * |
| | | * @param dictEntity |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer insertDict(DictEntity dictEntity); |
| | | public Integer insert(DictEntity entity); |
| | | |
| | | /** |
| | | * æå
¥å¤æ¡ |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer insertDicts(List<DictEntity> list); |
| | | public Integer inserts(List<DictEntity> list); |
| | | |
| | | /** |
| | | * å é¤ä¸æ¡ |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer deleteDict(int id); |
| | | public Integer delete(int id); |
| | | |
| | | /** |
| | | * å é¤å¤æ¡ |
| | |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public Integer deleteDicts(List<Integer> ids); |
| | | public Integer deletes(List<Integer> ids); |
| | | |
| | | /** |
| | | * æ´æ°ä¸æ¡ |
| | | * |
| | | * @param dictEntity |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer updateDict(DictEntity dictEntity); |
| | | public Integer update(DictEntity entity); |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ¡æ°æ® |
| | | * æ´æ°å¤æ¡ |
| | | * |
| | | * @param id |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public DictEntity selectDict(int id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<DictEntity> selectDictAll(); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¡¨æ ¼ä¸æå |
| | | * |
| | | * @return |
| | | */ |
| | | public List<DictEntity> selectDictTab(); |
| | | public Integer updates(List<DictEntity> list); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.lf.server.entity.ctrl.IdNameEntity; |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import com.lf.server.helper.AesHelper; |
| | | import com.lf.server.helper.ClassHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | |
| | | |
| | | return baseQueryMapper.selectDepFuzzy(name); |
| | | } |
| | | |
| | | @Override |
| | | public List<DictEntity> selectTabs() { |
| | | return baseQueryMapper.selectTabs(); |
| | | } |
| | | } |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.data.DictMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | * åå
¸ |
| | | * @author WWW |
| | | */ |
| | | @Service |
| | | public class DictService implements DictMapper { |
| | |
| | | DictMapper dictMapper; |
| | | |
| | | @Override |
| | | public Integer selectCount(String tab) { |
| | | return dictMapper.selectCount(tab); |
| | | public Integer selectCount(String ns, String tab) { |
| | | ns = StringHelper.isNull(ns) ? null : ns.trim(); |
| | | tab = StringHelper.getLikeStr(tab); |
| | | |
| | | return dictMapper.selectCount(ns, tab); |
| | | } |
| | | |
| | | @Override |
| | | public List<DictEntity> selectByPage(String tab, Integer limit, Integer offset) { |
| | | return dictMapper.selectByPage(tab, limit, offset); |
| | | public List<DictEntity> selectByPage(String ns, String tab, Integer limit, Integer offset) { |
| | | ns = StringHelper.isNull(ns) ? null : ns.trim(); |
| | | tab = StringHelper.getLikeStr(tab); |
| | | |
| | | return dictMapper.selectByPage(ns, tab, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertDict(DictEntity dictEntity) { |
| | | return dictMapper.insertDict(dictEntity); |
| | | public List<DictEntity> selectAll() { |
| | | return dictMapper.selectAll(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertDicts(List<DictEntity> dictEntity) { |
| | | return dictMapper.insertDicts(dictEntity); |
| | | public DictEntity selectById(int id) { |
| | | return dictMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteDict(int id) { |
| | | return dictMapper.deleteDict(id); |
| | | public Integer insert(DictEntity entity) { |
| | | return dictMapper.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteDicts(List<Integer> ids) { |
| | | return dictMapper.deleteDicts(ids); |
| | | public Integer inserts(List<DictEntity> list) { |
| | | return dictMapper.inserts(list); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateDict(DictEntity dictEntity) { |
| | | return dictMapper.updateDict(dictEntity); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public DictEntity selectDict(int id) { |
| | | return dictMapper.selectDict(id); |
| | | public Integer delete(int id) { |
| | | return dictMapper.delete(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<DictEntity> selectDictAll() { |
| | | return dictMapper.selectDictAll(); |
| | | public Integer deletes(List<Integer> ids) { |
| | | return dictMapper.deletes(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<DictEntity> selectDictTab() { |
| | | return dictMapper.selectDictTab(); |
| | | public Integer update(DictEntity entity) { |
| | | return dictMapper.update(entity); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Integer updates(List<DictEntity> list) { |
| | | return dictMapper.updates(list); |
| | | } |
| | | } |
| | |
| | | </where> |
| | | order by order_num limit 10 |
| | | </select> |
| | | |
| | | <select id="selectTabs" resultType="com.lf.server.entity.data.DictEntity"> |
| | | select distinct ns,fn_get_entity(tab) tab,tab_desc,tabletype from lf.sys_dict order by tab; |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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"> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.lf.server.mapper.data.DictMapper"> |
| | | <!--<resultMap id="resultMap" type="com.lf.server.entity.data.DictEntity"> |
| | | <id property="id" column="id"></id> |
| | |
| | | <result property="updateTime" column="update_time"></result> |
| | | </resultMap>--> |
| | | |
| | | <!-- ç»è®¡è¡æ° --> |
| | | <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String"> |
| | | select count(*) from lf.sys_dict |
| | | <where> |
| | | ns = #{ns} |
| | | <if test="tab != null"> |
| | | tab = #{tab} |
| | | and tab like #{tab} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- å页æ¥è¯¢ --> |
| | | <select id="selectByPage" resultType="com.lf.server.entity.data.DictEntity"> |
| | | select * from lf.sys_dict |
| | | <where> |
| | | ns = #{ns} |
| | | <if test="tab != null"> |
| | | tab = #{tab} |
| | | and tab like #{tab} |
| | | </if> |
| | | </where> |
| | | order by ns,tab,order_num |
| | | order by id |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectDictTab" resultType="com.lf.server.entity.data.DictEntity"> |
| | | select Distinct tab,tab_desc from lf.sys_dict; |
| | | </select> |
| | | |
| | | <select id="selectDictAll" resultType="com.lf.server.entity.data.DictEntity"> |
| | | <select id="selectAll" resultType="com.lf.server.entity.data.DictEntity"> |
| | | select * from lf.sys_dict order by id; |
| | | </select> |
| | | |
| | | <select id="selectDict" resultType="com.lf.server.entity.data.DictEntity"> |
| | | <select id="selectById" resultType="com.lf.server.entity.data.DictEntity"> |
| | | select * from lf.sys_dict where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertDict" parameterType="com.lf.server.entity.data.DictEntity"> |
| | | <insert id="insert" parameterType="com.lf.server.entity.data.DictEntity"> |
| | | insert into lf.sys_dict |
| | | (ns,tab,tab_desc,field,alias,type,len,precision,order_num,create_user,create_time,bak) |
| | | (ns,tab,tab_desc,field,alias,type,len,precision,order_num,create_user,create_time,tabletype,unit,domain_na,showtype,editable,bak) |
| | | values |
| | | (#{ns},#{tab},#{tabDesc},#{field},#{alias},#{type},#{len},#{precision},#{orderNum},#{createUser}, |
| | | now(),#{bak}); |
| | | (#{ns},#{tab},#{tabDesc},#{field},#{alias},#{type},#{len},#{precision},#{orderNum},#{createUser},now(),#{tabletype},#{unit},#{domainNa},#{showtype},#{editable},#{bak}) |
| | | </insert> |
| | | |
| | | <insert id="insertDicts"> |
| | | insert into lf.sys_dict |
| | | (ns,tab,tab_desc,field,alias,type,len,precision,order_num,create_user,create_time,bak) |
| | | values |
| | | <insert id="inserts"> |
| | | insert into lf.sys_dict |
| | | (ns,tab,tab_desc,field,alias,type,len,precision,order_num,create_user,create_time,tabletype,unit,domain_na,showtype,editable,bak) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.ns},#{item.tab},#{item.tabDesc},#{item.field},#{item.alias},#{item.type},#{item.len}, |
| | | #{item.precision},#{item.orderNum},#{item.createUser},now(),#{item.bak}) |
| | | (#{item.ns},#{item.tab},#{item.tabDesc},#{item.field},#{item.alias},#{item.type},#{item.len},#{item.precision},#{item.orderNum},#{item.createUser},now(),#{item.tabletype},#{item.unit},#{item.domainNa},#{item.showtype},#{item.editable},#{item.bak}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="deleteDict"> |
| | | <delete id="delete"> |
| | | delete from lf.sys_dict where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteDicts"> |
| | | <delete id="deletes"> |
| | | delete from lf.sys_dict where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateDict"> |
| | | update lf.sys_dict set ns=#{ns},tab=#{tab},tab_desc=#{tabDesc},field=#{field},alias=#{alias},type=#{type}, |
| | | len=#{len},precision=#{precision}, order_num=#{orderNum},update_user=#{updateUser},update_time=now(),bak=#{bak} where id=#{id} |
| | | <update id="update"> |
| | | update lf.sys_dict |
| | | set ns=#{ns},tab=#{tab},tab_desc=#{tabDesc},field=#{field},alias=#{alias},type=#{type},len=#{len},precision=#{precision},order_num=#{orderNum},update_user=#{updateUser},update_time=now(),tabletype=#{tabletype},unit=#{unit},domain_na=#{domainNa},showtype=#{showtype},editable=#{editable},bak=#{bak} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_dict |
| | | <set> |
| | | ns=#{item.ns},tab=#{item.tab},tab_desc=#{item.tabDesc},field=#{item.field},alias=#{item.alias},type=#{item.type},len=#{item.len},precision=#{item.precision},order_num=#{item.orderNum},update_user=#{item.updateUser},update_time=now(),tabletype=#{item.tabletype},unit=#{item.unit},domain_na=#{item.domainNa},showtype=#{item.showtype},editable=#{item.editable},bak=#{item.bak} |
| | | </set> |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |
| | |
| | | 29.å¼åæ¹éä¿®æ¹ç¨æ·å¯ç æ¥å£ |
| | | 30.å¼åä¸ä¼ Shpæä»¶åè½ |
| | | 31.使ç¨Gdal读åShpæä»¶ï¼è¯»ååå 餿件 < |
| | | |
| | | 32. |
| | | 33. |
| | | 34. |
| | | 35. |
| | | 36. |
| | | 37. |
| | | 38. |
| | | 39. |
| | | 40. |
| | | ----------------------------------------------- |
| | | .å¯¹ç¨æ·ãèåãè§è²ãèµæºè¿è¡ææ |
| | | .æ·»å æ¥è¯¢è§è²ãèåãèµæºæéæ¥å£ |