You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
4.4 KiB
99 lines
4.4 KiB
<?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.daqing.financial.hrauth.dao.UserLoginDao"> |
|
<!-- 可根据自己的需求,是否要使用 --> |
|
<resultMap type="com.daqing.framework.domain.hrms.UserEntity" id="userMap"> |
|
<result property="id" column="id"/> |
|
<result property="account" column="account"/> |
|
<result property="phoneAccount" column="phone_account"/> |
|
<result property="password" column="password"/> |
|
<result property="loginNum" column="login_num"/> |
|
<result property="createTime" column="create_time"/> |
|
<result property="motifyTime" column="motify_time"/> |
|
<result property="headPortaritUrl" column="head_portarit_url"/> |
|
</resultMap> |
|
<update id="updatePasswordByPhoneAccount"> |
|
update hrms_user set password = #{password} where phone_account = #{phoneAccount} |
|
</update> |
|
|
|
<select id="getUser" parameterType="string" resultType="com.daqing.framework.domain.hrms.UserEntity"> |
|
SELECT id,account,password FROM hrms_user WHERE account = #{account} |
|
</select> |
|
<select id="selectPhoneCount" resultType="java.lang.Integer"> |
|
select count(1) from hrms_user where phone_account = #{phoneAccount} |
|
</select> |
|
|
|
<select id="login" parameterType="com.daqing.framework.domain.hrms.request.LoginRequest" resultType="com.daqing.framework.domain.hrms.UserEntity"> |
|
select hu.id,hu.account,hu.phone_account,hu.password,hu.login_num,hu.head_portarit_url |
|
from hrms_user hu |
|
INNER JOIN hrms_employee he ON he.user_id=hu.id |
|
where hu.del_or_not = 0 and hu.status = 0 |
|
<if test="phone != null and phone != '' "> |
|
and (hu.phone_account = #{phone} or hu.account = #{phone}) |
|
</if> |
|
<if test="wechatId != null and wechatId != '' "> |
|
and hu.wechat_id = #{wechatId} |
|
</if> |
|
|
|
</select> |
|
|
|
<select id="xcxLogin" parameterType="com.daqing.framework.domain.hrms.request.LoginRequest" resultType="com.daqing.framework.domain.hrms.UserEntity"> |
|
select hu.id,hu.account,hu.phone_account,hu.password,hu.login_num,hu.head_portarit_url |
|
from hrms_user hu |
|
where hu.del_or_not = 0 and hu.status = 0 |
|
<if test="phone != null and phone != '' "> |
|
and (hu.phone_account = #{phone} or hu.account = #{phone}) |
|
</if> |
|
<if test="wechatId != null and wechatId != '' "> |
|
and hu.wechat_id = #{wechatId} |
|
</if> |
|
<if test="type != null"> |
|
and hu.type = #{type} |
|
</if> |
|
</select> |
|
|
|
<select id="selectByPhoneAccount" resultType="com.daqing.framework.domain.hrms.UserEntity"> |
|
SELECT id,account,password FROM hrms_user WHERE phone_account = #{phoneAccount} |
|
</select> |
|
<select id="findByOpenid" parameterType="string" resultType="com.daqing.framework.domain.hrms.UserEntity"> |
|
SELECT hu.id,hu.phone_account FROM hrms_user hu INNER JOIN hrms_employee he ON he.user_id=hu.id WHERE hu.wechat_id = #{openId} |
|
</select> |
|
|
|
<update id="updateOpenIdByPhoneAccount"> |
|
update hrms_user set wechat_id = #{wechatId} where phone_account = #{phoneAccount} |
|
</update> |
|
|
|
<!-- 绑定微信 --> |
|
<update id="updateWeChat"> |
|
UPDATE hrms_user SET wechat_id = #{weChatId} WHERE id = #{id} |
|
</update> |
|
|
|
<select id="getTokenByUserId" parameterType="long" resultType="string"> |
|
SELECT token FROM hrms_token WHERE user_id = #{userId} |
|
</select> |
|
|
|
<update id="updateUserLogin"> |
|
UPDATE hrms_user SET login_num = login_num + 1,lasttime = #{date} WHERE id = #{userId} |
|
</update> |
|
|
|
<select id="countWeChatId" parameterType="string" resultType="integer"> |
|
SELECT COUNT(id) FROM hrms_user WHERE wechat_id = #{weChatId} |
|
</select> |
|
|
|
<select id="getNameByUserId" parameterType="long" resultType="string"> |
|
SELECT `name` FROM hrms_employee WHERE user_id = #{userId} |
|
</select> |
|
<select id="selectByManagerId" resultType="com.daqing.framework.domain.hrms.UserEntity"> |
|
select * from hrms_user where id=1 |
|
</select> |
|
|
|
<update id="updateManagePassword"> |
|
update hrms_user set password = #{password} where id=1 |
|
</update> |
|
|
|
<select id="selectUserEmpCount" parameterType="string" resultType="integer"> |
|
SELECT COUNT(0) FROM hrms_user hu INNER JOIN hrms_employee he ON he.user_id=hu.id WHERE hu.wechat_id = #{md5UnionId} |
|
</select> |
|
|
|
</mapper> |