upd: 编码规范
This commit is contained in:
+3
-4
@@ -14,10 +14,9 @@ import java.util.Set;
|
||||
|
||||
@Mapper
|
||||
public interface DictDetailMapper extends BaseMapper<DictDetail> {
|
||||
List<DictDetail> findDictDetailByDictName(@Param("name") String name);
|
||||
|
||||
List<DictDetail> selectByDictName(@Param("name") String name);
|
||||
IPage<DictDetail> findDictDetail(@Param("criteria") DictDetailQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
IPage<DictDetail> selectByPage(@Param("criteria") DictDetailQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
void deleteBatchByDictIds(@Param("dictIds") Set<Long> dictIds);
|
||||
void deleteDictDetailsByDictIds(@Param("dictIds") Set<Long> dictIds);
|
||||
}
|
||||
+2
-2
@@ -29,7 +29,7 @@ public class DictDetailServiceImpl extends ServiceImpl<DictDetailMapper, DictDet
|
||||
|
||||
@Override
|
||||
public PageResult<DictDetail> queryAll(DictDetailQueryCriteria criteria, Page<Object> page) {
|
||||
return PageUtil.toPage(dictDetailMapper.selectByPage(criteria, page));
|
||||
return PageUtil.toPage(dictDetailMapper.findDictDetail(criteria, page));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +57,7 @@ public class DictDetailServiceImpl extends ServiceImpl<DictDetailMapper, DictDet
|
||||
String key = CacheKey.DICT_NAME + name;
|
||||
List<DictDetail> dictDetails = redisUtil.getList(key, DictDetail.class);
|
||||
if (CollUtil.isEmpty(dictDetails)) {
|
||||
dictDetails = dictDetailMapper.selectByDictName(name);
|
||||
dictDetails = dictDetailMapper.findDictDetailByDictName(name);
|
||||
redisUtil.set(key, dictDetails, 1, TimeUnit.DAYS);
|
||||
}
|
||||
return dictDetails;
|
||||
|
||||
+2
-2
@@ -69,14 +69,14 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements Di
|
||||
// 删除字典
|
||||
dictMapper.deleteBatchIds(ids);
|
||||
// 删除字典详情
|
||||
dictDetailMapper.deleteBatchByDictIds(ids);
|
||||
dictDetailMapper.deleteDictDetailsByDictIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<Dict> dicts, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (Dict dict : dicts) {
|
||||
List<DictDetail> dictDetails = dictDetailMapper.selectByDictName(dict.getName());
|
||||
List<DictDetail> dictDetails = dictDetailMapper.findDictDetailByDictName(dict.getName());
|
||||
if (CollectionUtil.isNotEmpty(dictDetails)) {
|
||||
for (DictDetail dictDetail : dictDetails) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
|
||||
@@ -17,7 +17,18 @@
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByPage" resultMap="BaseResultMap">
|
||||
<select id="findDictDetailByDictName" resultMap="BaseResultMap">
|
||||
select
|
||||
dd.id, dd.label, dd.`value`, dd.`dict_sort`, dd.create_by, dd.update_by, dd.create_time, dd.update_time,
|
||||
d.id as dict_id, d.name
|
||||
from sys_dict_detail dd, sys_dict d
|
||||
where dd.dict_id = d.id
|
||||
<if test="name != null and name != ''">
|
||||
and d.name = #{name}
|
||||
</if>
|
||||
order by dd.dict_sort
|
||||
</select>
|
||||
<select id="findDictDetail" resultMap="BaseResultMap">
|
||||
select
|
||||
dd.id, dd.label, dd.`value`, dd.`dict_sort`, dd.create_by, dd.update_by, dd.create_time, dd.update_time,
|
||||
d.id as dict_id, d.name
|
||||
@@ -31,20 +42,7 @@
|
||||
</if>
|
||||
order by dd.dict_sort, dd.dict_id desc
|
||||
</select>
|
||||
|
||||
<select id="selectByDictName" resultMap="BaseResultMap">
|
||||
select
|
||||
dd.id, dd.label, dd.`value`, dd.`dict_sort`, dd.create_by, dd.update_by, dd.create_time, dd.update_time,
|
||||
d.id as dict_id, d.name
|
||||
from sys_dict_detail dd, sys_dict d
|
||||
where dd.dict_id = d.id
|
||||
<if test="name != null and name != ''">
|
||||
and d.name = #{name}
|
||||
</if>
|
||||
order by dd.dict_sort
|
||||
</select>
|
||||
|
||||
<delete id="deleteBatchByDictIds">
|
||||
<delete id="deleteDictDetailsByDictIds">
|
||||
delete from sys_dict_detail
|
||||
where dict_id in
|
||||
<foreach collection="dictIds" item="item" index="index" open="(" separator="," close=")">
|
||||
|
||||
Reference in New Issue
Block a user