From 578e49d67183d8d12a6af7e8244a9d152cb366d4 Mon Sep 17 00:00:00 2001 From: ZhuDongming <773644075@qq.com> Date: Wed, 09 Oct 2019 14:02:21 +0800 Subject: [PATCH] 大屏后台管理代码update --- src/main/resources/mapper/AccountMapper.xml | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/main/resources/mapper/AccountMapper.xml b/src/main/resources/mapper/AccountMapper.xml index 71dcf36..c7c2903 100644 --- a/src/main/resources/mapper/AccountMapper.xml +++ b/src/main/resources/mapper/AccountMapper.xml @@ -1,7 +1,35 @@ -<?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"> - <select id="getRoleNameByAccountId" resultType="map"> + <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" /> + <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> + <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 @@ -11,4 +39,20 @@ ar.role_id = r.id AND ar.account_id = #{accountId} </select> + + <select id="getOrganizationIdByAccountId" resultType="java.util.Map"> + SELECT organization_id + FROM account + WHERE id=#{id} + </select> + + <select id="getAccountList" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List"/> + from account + where is_delete=0 and expire_time > now() + <if test="accountName != 'null'"> + and account_name like concat('%',#{accountName},'%') + </if> + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0