|
|
@@ -12,20 +12,42 @@
|
|
|
<result column="joined_cps" property="joinedCps"
|
|
|
typeHandler="com.dk.common.infrastructure.handler.IntListTypeHandler"/>
|
|
|
<result column="flg_valid" property="flgValid"/>
|
|
|
+ <collection property="joinedCpList" columnPrefix="join_" resultMap="companyMap"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <!-- 查询条件设置通用查询映射结果 -->
|
|
|
+ <resultMap id="companyMap" type="com.dk.oauth.entity.CompanyResponse">
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ <result column="cp_code" property="cpCode"/>
|
|
|
+ <result column="cp_name" property="cpName"/>
|
|
|
+ <result column="svc_code" property="svcCode"/>
|
|
|
+ <result column="svc_ip" property="svcIp"/>
|
|
|
+ <result column="svc_port" property="svcPort"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 根据电话号码获取用户信息 -->
|
|
|
<select id="getByPhone" resultMap="ResultMap">
|
|
|
SELECT
|
|
|
- user_id, user_wxid, user_name, user_phone, user_pwd, current_cp, flg_valid
|
|
|
- FROM dkic_a.t_wx_user
|
|
|
- where user_phone = #{userPhone}
|
|
|
+ txu.user_id, txu.user_wxid, txu.user_name, txu.user_phone, txu.user_pwd, txu.current_cp, txu.flg_valid,txu.joined_cps,
|
|
|
+ tac.cp_id AS "join_cp_id",tac.cp_code AS "join_cp_code",tac.cp_name AS "join_cp_name",tac.svc_code AS "join_svc_code",
|
|
|
+ tss.svc_ip AS "join_svc_ip",tss.svc_port AS "join_svc_port"
|
|
|
+ FROM dkic_a.t_wx_user txu
|
|
|
+ LEFT JOIN dkic_a.t_a_company tac
|
|
|
+ ON tac.cp_id = ANY(txu.joined_cps)
|
|
|
+ AND (tac.end_date is null or tac.end_date > now())
|
|
|
+ LEFT JOIN dkic_a.t_s_service tss
|
|
|
+ ON tac.svc_code = tss.svc_code
|
|
|
+ AND tss.flg_valid
|
|
|
+ where txu.user_phone = #{userPhone}
|
|
|
+ AND txu.flg_valid
|
|
|
</select>
|
|
|
|
|
|
<select id="getByWxid" resultMap="ResultMap">
|
|
|
SELECT
|
|
|
- user_id, user_wxid, user_name, user_phone, user_pwd, current_cp, joined_cps,flg_valid
|
|
|
- FROM dkic_a.t_wx_user
|
|
|
- where user_wxid = #{userWxid}
|
|
|
+ txu.user_id, txu.user_wxid, txu.user_name, txu.user_phone, txu.user_pwd, txu.current_cp, txu.joined_cps,txu.flg_valid
|
|
|
+ FROM dkic_a.t_wx_user txu
|
|
|
+ where txu.user_wxid = #{userWxid}
|
|
|
+ AND txu.flg_valid
|
|
|
</select>
|
|
|
|
|
|
<select id="selectById" resultMap="ResultMap">
|
|
|
@@ -56,7 +78,8 @@
|
|
|
</update>
|
|
|
<!--更新微信用的公司-->
|
|
|
<update id="updateCpid">
|
|
|
- update dkic_a.t_wx_user set current_cp = #{currentCp},joined_cps = #{joinedCps,typeHandler=IntListTypeHandler}
|
|
|
+ update dkic_a.t_wx_user set current_cp = #{currentCp},
|
|
|
+ joined_cps = #{joinedCps,typeHandler=IntListTypeHandler}
|
|
|
where user_id = #{userId}::uuid
|
|
|
</update>
|
|
|
|
|
|
@@ -93,4 +116,16 @@
|
|
|
WHERE user_id = #{userId}::uuid
|
|
|
AND app_code = #{appCode}
|
|
|
</select>
|
|
|
+
|
|
|
+ <!-- 修改密码 -->
|
|
|
+ <update id="updatePassword">
|
|
|
+ update dkic_a.t_wx_user
|
|
|
+ <set>
|
|
|
+ <if test="userPwd != null">
|
|
|
+ user_pwd = #{userPwd},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where user_id = #{userId}
|
|
|
+ </update>
|
|
|
+
|
|
|
</mapper>
|