|
@@ -1,12 +1,43 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?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">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ytpm.middle.dao.MiddleUserMapper">
|
|
<mapper namespace="com.ytpm.middle.dao.MiddleUserMapper">
|
|
|
|
|
+ <insert id="insertOne">
|
|
|
|
|
+ INSERT INTO yt_platform_user (
|
|
|
|
|
+ user_id,
|
|
|
|
|
+ nick_name,
|
|
|
|
|
+ head_image,
|
|
|
|
|
+ login_name,
|
|
|
|
|
+ encrypt_pwd,
|
|
|
|
|
+ salt,
|
|
|
|
|
+ phone,
|
|
|
|
|
+ last_login_time,
|
|
|
|
|
+ account_status,
|
|
|
|
|
+ user_type,
|
|
|
|
|
+ registry_time,
|
|
|
|
|
+ dept_id
|
|
|
|
|
+ )
|
|
|
|
|
+ VALUES
|
|
|
|
|
+ (
|
|
|
|
|
+ #{userId},
|
|
|
|
|
+ #{nickName},
|
|
|
|
|
+ #{headImage},
|
|
|
|
|
+ #{loginName},
|
|
|
|
|
+ #{encryptPwd},
|
|
|
|
|
+ #{salt},
|
|
|
|
|
+ #{phone},
|
|
|
|
|
+ #{lastLoginTime},
|
|
|
|
|
+ #{accountStatus},
|
|
|
|
|
+ #{userType},
|
|
|
|
|
+ #{registryTime},
|
|
|
|
|
+ #{deptId}
|
|
|
|
|
+ );
|
|
|
|
|
+ </insert>
|
|
|
|
|
|
|
|
<select id="getByLoginName" resultType="com.ytpm.middle.view.MiddleUserInfo">
|
|
<select id="getByLoginName" resultType="com.ytpm.middle.view.MiddleUserInfo">
|
|
|
select
|
|
select
|
|
|
- user_id, nick_name, head_image, login_name, encrypt_pwd, salt, phone, last_login_time, last_login_ip, phone_brand, phone_model, account_status, channel_id, user_type, login_days, total_income, app_id, registry_time, transfer_amount
|
|
|
|
|
|
|
+ user_id, nick_name, head_image, login_name, encrypt_pwd, salt, phone, last_login_time, account_status, user_type, registry_time
|
|
|
from yt_platform_user
|
|
from yt_platform_user
|
|
|
- where login_name = #{userName}
|
|
|
|
|
|
|
+ where user_type = 99 and login_name = #{userName}
|
|
|
</select>
|
|
</select>
|
|
|
<select id="getRoleList" resultType="com.ytpm.middle.view.MiddleRoleVO">
|
|
<select id="getRoleList" resultType="com.ytpm.middle.view.MiddleRoleVO">
|
|
|
select
|
|
select
|
|
@@ -18,4 +49,52 @@
|
|
|
join yt_middle_role ymr on ymur.role_id = ymr.role_id
|
|
join yt_middle_role ymr on ymur.role_id = ymr.role_id
|
|
|
where ymur.user_id = #{userId}
|
|
where ymur.user_id = #{userId}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+ <resultMap id="MiddleUserMap" type="com.ytpm.middle.view.MiddleUserInfo">
|
|
|
|
|
+ <id column="user_id" property="userId" />
|
|
|
|
|
+ <result column="" property="nickName" />
|
|
|
|
|
+ <result column="" property="headImage" />
|
|
|
|
|
+ <result column="" property="loginName" />
|
|
|
|
|
+ <result column="" property="phone" />
|
|
|
|
|
+ <result column="" property="lastLoginTime" />
|
|
|
|
|
+ <collection property="roleList" ofType="com.ytpm.middle.view.MiddleRoleVO">
|
|
|
|
|
+ <id column="role_id" property="roleId" />
|
|
|
|
|
+ <result column="roleName" property="roleName" />
|
|
|
|
|
+ </collection>
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+ <select id="queryList" resultMap="MiddleUserMap">
|
|
|
|
|
+ select
|
|
|
|
|
+ ypu.user_id,
|
|
|
|
|
+ ypu.dept_id,
|
|
|
|
|
+ ymd.dept_id,
|
|
|
|
|
+ ymur.role_id,
|
|
|
|
|
+ (select role_name from yt_middle_role where role_id = ymur.role_id) roleName,
|
|
|
|
|
+ ypu.nick_name,
|
|
|
|
|
+ ypu.head_image,
|
|
|
|
|
+ ypu.login_name,
|
|
|
|
|
+ ypu.phone,
|
|
|
|
|
+ ypu.last_login_time,
|
|
|
|
|
+ ypu.last_login_ip
|
|
|
|
|
+ from yt_platform_user ypu
|
|
|
|
|
+ left join yt_middle_user_role ymur on ypu.user_id = ymur.user_id
|
|
|
|
|
+ left join yt_middle_dept ymd on ypu.dept_id = ymd.dept_id
|
|
|
|
|
+ where ypu.user_type = 99
|
|
|
|
|
+ <if test=" nickName!= null and nickName!= ''">
|
|
|
|
|
+ and ypu.nick_name like concat('%', #{nickName} ,'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="loginName != null and loginName!= ''">
|
|
|
|
|
+ and ypu.login_name like concat('%', #{loginName} ,'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="phone != null and phone!= ''">
|
|
|
|
|
+ and ypu.phone like concat('%', #{phone} ,'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="accountStatus != null">
|
|
|
|
|
+ and ypu.account_status = #{accountStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="getByPhone" resultType="com.ytpm.middle.view.MiddleUserInfo">
|
|
|
|
|
+ select
|
|
|
|
|
+ user_id, nick_name, head_image, login_name, encrypt_pwd, salt, phone, last_login_time, account_status, user_type, registry_time
|
|
|
|
|
+ from yt_platform_user
|
|
|
|
|
+ where user_type = 99 and account_status = 1 and phone = #{phone}
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|