|
@@ -18,7 +18,18 @@
|
18
|
18
|
<result property="depName" column="dep_name"></result>
|
19
|
19
|
</association>
|
20
|
20
|
</resultMap>
|
21
|
|
-
|
|
21
|
+ <resultMap id="finByStepMap" type="com.pojo.dto.AccountVO">
|
|
22
|
+ <id property="id" column="id"></id>
|
|
23
|
+ <result property="userName" column="user_name"></result>
|
|
24
|
+ <result property="balance" column="balance"></result>
|
|
25
|
+ <result property="depId" column="dep_id"></result>
|
|
26
|
+ <association property="departmentEntity"
|
|
27
|
+ select="com.mapper.DepartmentMapper.findById"
|
|
28
|
+ column="dep_id"
|
|
29
|
+ ></association>
|
|
30
|
+ </resultMap>
|
|
31
|
+
|
|
32
|
+
|
22
|
33
|
<select id="findAll" resultType="account"
|
23
|
34
|
parameterType="java.lang.Integer"
|
24
|
35
|
>
|
|
@@ -37,5 +48,8 @@
|
37
|
48
|
select a.*,b.dep_name from account a left join department b on a.dep_id = b.dep_id
|
38
|
49
|
where a.id = #{id}
|
39
|
50
|
</select>
|
40
|
|
-
|
|
51
|
+<!-- 分步查询 1-->
|
|
52
|
+ <select id="findByStep" parameterType="java.lang.Integer" resultMap="finByStepMap">
|
|
53
|
+ select * from account where id= #{id}
|
|
54
|
+ </select>
|
41
|
55
|
</mapper>
|