xufenglei
2017-12-07 dba72443e05e7b0a52ee85bfd9f4641aebc42c60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?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.moral.mapper.AccountMapper">
  <resultMap id="BaseResultMap" type="com.moral.entity.Account">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="account_name" jdbcType="VARCHAR" property="accountName" />
    <result column="password" jdbcType="VARCHAR" property="password" />
    <result column="organization_id" jdbcType="INTEGER" property="organizationId" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="mobile" jdbcType="VARCHAR" property="mobile" />
    <result column="weixin" jdbcType="VARCHAR" property="weixin" />
    <result column="is_delete" jdbcType="CHAR" property="isDelete" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
  </resultMap>
 
    <select id="getRoleNameByAccountId" resultType="map">
        SELECT
            r.role_name
        FROM
            role r,
            account_role ar
        WHERE
            ar.role_id = r.id
        AND ar.account_id = #{accountId}
    </select>
</mapper>