Skip to content

Commit d16d50a

Browse files
author
MistletoeXW
committed
fix:修改领导查询
1 parent 32a2240 commit d16d50a

2 files changed

Lines changed: 16 additions & 24 deletions

File tree

src/main/resources/mapping/UserMapper.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<result column="is_able_login" property="isAbleLogin" jdbcType="INTEGER" />
1616
<result column="leader_id" property="leaderId" jdbcType="VARCHAR" />
1717
</resultMap>
18-
<resultMap id="LeaderMap" type="com.management.model.entity.LeaderInfo">
19-
<id column="user_id" property="userId" jdbcType="VARCHAR" />
20-
<result column="user_name" property="userName" jdbcType="VARCHAR" />
21-
<result column="department" property="department" jdbcType="VARCHAR" />
22-
</resultMap>
18+
<resultMap id="LeaderMap" type="com.management.model.entity.LeaderInfo">
19+
<id column="user_id" property="userId" jdbcType="VARCHAR" />
20+
<result column="user_name" property="userName" jdbcType="VARCHAR" />
21+
<result column="department" property="department" jdbcType="VARCHAR" />
22+
</resultMap>
2323
<resultMap id="UserInfoMap" type="com.management.model.entity.UserBaseInfo" >
2424
<result column="user_id" property="userId" jdbcType="VARCHAR" />
2525
<result column="user_name" property="userName" jdbcType="VARCHAR" />
@@ -111,9 +111,9 @@
111111
<sql id="User_Info_List">
112112
user_id, user_name, sex, department, phone, mail, position, major,is_able_login,identity,leader_id
113113
</sql>
114-
<sql id="Leader_Info_List">
115-
user_id,user_name,department
116-
</sql>
114+
<sql id="Leader_Info_List">
115+
user_id,user_name,department
116+
</sql>
117117
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.management.model.entity.UserExample" >
118118
select
119119
<if test="distinct" >
@@ -361,13 +361,13 @@
361361
<select id="selectExpertInfoList" resultMap="BaseResultMap" parameterType="java.lang.String">
362362
select <include refid="Base_Column_List"/>
363363
from tbl_User
364-
where instr('3',rtrim(identity)) > 0 and is_able_login = 1
364+
where identity like "%3%" and is_able_login = 1
365+
</select>
366+
<select id="selectLeaderInfoList" resultMap="LeaderMap" parameterType="java.lang.String">
367+
select <include refid="Leader_Info_List"/>
368+
from tbl_User
369+
where identity like "%4%" and is_able_login = 1
365370
</select>
366-
<select id="selectLeaderInfoList" resultMap="LeaderMap" parameterType="java.lang.String">
367-
select <include refid="Leader_Info_List"/>
368-
from tbl_User
369-
where instr('4',rtrim(identity)) > 0 and is_able_login = 1
370-
</select>
371371
<select id="selectUserInfoByUserId" resultMap="UserInfoMap" parameterType="java.lang.String">
372372
select
373373
<include refid="User_Info_List"/>

src/test/java/com/management/dao/ProjectApplicationMapperTest.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,7 @@ public class ProjectApplicationMapperTest {
2929

3030
@Test
3131
public void queryAdminProjectApplication() {
32-
//System.out.print(userMapper.selectAllUserInfo((1-1)*10));
33-
//System.out.print(superAdminService.getUserInfo());
34-
// List<String> identity = new ArrayList<>(Arrays.asList("user","leader"));
35-
// UpdateOrInsertUser updateOrInsertUser = new UpdateOrInsertUser();
36-
// updateOrInsertUser.setUserId("12112");
37-
// updateOrInsertUser.setUserName("xxxx");
38-
// updateOrInsertUser.setPassword("11111");
39-
// updateOrInsertUser.setIdentity(identity);
40-
// System.out.print(superAdminService.insertUser(updateOrInsertUser));
41-
System.out.print(projectApplicationMapper.selectMyApplication("user1"));
32+
System.out.print(userMapper.selectExpertInfoList("3"));
33+
//System.out.print(userMapper.selectLeaderInfoList("4"));
4234
}
4335
}

0 commit comments

Comments
 (0)