Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
964f3fc2
Commit
964f3fc2
authored
Feb 22, 2018
by
stylefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改字典dao
parent
4bec9ba9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
73 deletions
+44
-73
guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/DictController.java
+1
-5
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DictDao.java
+0
-33
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DictMapper.java
+15
-1
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DictDao.xml
+0
-26
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DictMapper.xml
+28
-8
No files found.
guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/DictController.java
View file @
964f3fc2
...
...
@@ -13,7 +13,6 @@ import com.stylefeng.guns.core.base.controller.BaseController;
import
com.stylefeng.guns.core.exception.GunsException
;
import
com.stylefeng.guns.core.log.LogObjectHolder
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.modular.system.dao.DictDao
;
import
com.stylefeng.guns.modular.system.service.IDictService
;
import
com.stylefeng.guns.modular.system.warpper.DictWarpper
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -40,9 +39,6 @@ public class DictController extends BaseController {
private
String
PREFIX
=
"/system/dict/"
;
@Resource
DictDao
dictDao
;
@Resource
DictMapper
dictMapper
;
@Resource
...
...
@@ -102,7 +98,7 @@ public class DictController extends BaseController {
@Permission
(
Const
.
ADMIN_NAME
)
@ResponseBody
public
Object
list
(
String
condition
)
{
List
<
Map
<
String
,
Object
>>
list
=
this
.
dict
Dao
.
list
(
condition
);
List
<
Map
<
String
,
Object
>>
list
=
this
.
dict
Mapper
.
list
(
condition
);
return
super
.
warpObject
(
new
DictWarpper
(
list
));
}
...
...
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DictDao.java
deleted
100644 → 0
View file @
4bec9ba9
package
com
.
stylefeng
.
guns
.
modular
.
system
.
dao
;
import
com.stylefeng.guns.modular.system.model.Dict
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* 字典的dao
*
* @author fengshuonan
* @date 2017年2月13日 下午11:10:24
*/
public
interface
DictDao
{
/**
* 根据编码获取词典列表
*
* @param code
* @return
* @date 2017年2月13日 下午11:11:28
*/
List
<
Dict
>
selectByCode
(
@Param
(
"code"
)
String
code
);
/**
* 查询字典列表
*
* @author fengshuonan
* @Date 2017/4/26 13:04
*/
List
<
Map
<
String
,
Object
>>
list
(
@Param
(
"condition"
)
String
conditiion
);
}
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DictMapper.java
View file @
964f3fc2
...
...
@@ -2,10 +2,14 @@ package com.stylefeng.guns.modular.system.dao;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.stylefeng.guns.modular.system.model.Dict
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 字典表 Mapper 接口
* 字典表 Mapper 接口
* </p>
*
* @author stylefeng
...
...
@@ -13,4 +17,13 @@ import com.stylefeng.guns.modular.system.model.Dict;
*/
public
interface
DictMapper
extends
BaseMapper
<
Dict
>
{
/**
* 根据编码获取词典列表
*/
List
<
Dict
>
selectByCode
(
@Param
(
"code"
)
String
code
);
/**
* 查询字典列表
*/
List
<
Map
<
String
,
Object
>>
list
(
@Param
(
"condition"
)
String
conditiion
);
}
\ No newline at end of file
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DictDao.xml
deleted
100644 → 0
View file @
4bec9ba9
<?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.stylefeng.guns.modular.system.dao.DictDao"
>
<sql
id=
"Base_Column_List"
>
id, num, pid, name, tips
</sql>
<select
id=
"selectByCode"
resultType=
"dict"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_dict
where code = #{code}
</select>
<select
id=
"list"
resultType=
"map"
>
select * from sys_dict
where pid = 0
<if
test=
"condition != null and condition != ''"
>
AND name like CONCAT('%',#{condition},'%')
</if>
order by id ASC
</select>
</mapper>
\ No newline at end of file
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DictMapper.xml
View file @
964f3fc2
...
...
@@ -2,13 +2,33 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.stylefeng.guns.modular.system.dao.DictMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"com.stylefeng.guns.modular.system.model.Dict"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"num"
property=
"num"
/>
<result
column=
"pid"
property=
"pid"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"tips"
property=
"tips"
/>
</resultMap>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"com.stylefeng.guns.modular.system.model.Dict"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"num"
property=
"num"
/>
<result
column=
"pid"
property=
"pid"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"tips"
property=
"tips"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, num, pid, name, tips
</sql>
<select
id=
"selectByCode"
resultType=
"dict"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_dict
where code = #{code}
</select>
<select
id=
"list"
resultType=
"map"
>
select * from sys_dict
where pid = 0
<if
test=
"condition != null and condition != ''"
>
AND name like CONCAT('%',#{condition},'%')
</if>
order by id ASC
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment