This repository was archived by the owner on Feb 5, 2022. It is now read-only.
File tree 2 files changed +8
-0
lines changed
dictator-web/src/main/java/com/github/liuyuyu/dictator/server/mapper
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com .github .liuyuyu .dictator .server .mapper ;
2
2
3
3
import com .github .liuyuyu .dictator .server .model .entity .DictatorConfigGroup ;
4
+ import com .google .common .collect .Maps ;
4
5
import lombok .NonNull ;
5
6
import org .apache .ibatis .annotations .Mapper ;
6
7
import tk .mybatis .mapper .weekend .Weekend ;
12
13
@ Mapper
13
14
public interface DictatorConfigGroupMapper extends SimpleMapper <DictatorConfigGroup > {
14
15
default Map <Long ,String > findConfigNameMapByGroupIdList (@ NonNull List <Long > configIdList ){
16
+ if (configIdList .isEmpty ()){
17
+ return Maps .newHashMap ();
18
+ }
15
19
Weekend <DictatorConfigGroup > weekend = Weekend .of (DictatorConfigGroup .class );
16
20
weekend .weekendCriteria ()
17
21
.andIn (DictatorConfigGroup ::getId ,configIdList );
Original file line number Diff line number Diff line change 1
1
package com .github .liuyuyu .dictator .server .mapper ;
2
2
3
3
import com .github .liuyuyu .dictator .server .model .entity .DictatorConfigProfile ;
4
+ import com .google .common .collect .Maps ;
4
5
import lombok .NonNull ;
5
6
import org .apache .ibatis .annotations .Mapper ;
6
7
import tk .mybatis .mapper .weekend .Weekend ;
13
14
@ Mapper
14
15
public interface DictatorConfigProfileMapper extends SimpleMapper <DictatorConfigProfile > {
15
16
default Map <Long , String > findProfileNameByIdList (@ NonNull List <Long > profileIdList ) {
17
+ if (profileIdList .isEmpty ()){
18
+ return Maps .newHashMap ();
19
+ }
16
20
Weekend <DictatorConfigProfile > weekend = Weekend .of (DictatorConfigProfile .class );
17
21
weekend .weekendCriteria ()
18
22
.andIn (DictatorConfigProfile ::getId ,profileIdList );
You can’t perform that action at this time.
0 commit comments