xufenglei
2018-07-12 b5ee321e0afc4c69e48a271c79cfd98c78da9f91
src/main/resources/mapper/AccountMapper.xml
@@ -1,5 +1,5 @@
<?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">
<?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" />
@@ -12,9 +12,24 @@
    <result column="is_delete" jdbcType="CHAR" property="isDelete" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
     <association property="jwtTokenVersion" javaType="com.moral.entity.JwtTokenVersion">
        <result column="jwt_token_version_id" property="id" jdbcType="INTEGER" />
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
     </association>
  </resultMap>
   <select id="getRoleNameByAccountId" resultType="map">
  <sql id="Base_Column_List">
    id, account_name, password, organization_id, email, mobile, weixin, is_delete, create_time,
    expire_time, user_name
  </sql>
  <select id="getByAccountName" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
      acc.*,jtv.id as jwt_token_version_id,jtv.update_time as update_time
    from account acc
   left join jwt_token_version jtv on acc.account_name = jtv.account_name
    where acc.account_name = #{name,jdbcType=VARCHAR}
   </select>
   <select id="getRoleNameByAccountId" resultType="java.util.Map">
      SELECT
         r.role_name
      FROM