|
|
@@ -19,5 +19,28 @@
|
|
|
<result column="status" property="status" />
|
|
|
|
|
|
</resultMap>
|
|
|
+ <select id="selectByLeader" resultMap="KxsLeaderMap">
|
|
|
+ select *
|
|
|
+ from kxs_leader
|
|
|
+ where user_id = #{userId}
|
|
|
+ and expired_date > #{expiredDate}
|
|
|
+ and del_flag = 0
|
|
|
+ </select>
|
|
|
+ <select id="selectUserTopLeaderInfo" resultType="com.kxs.user.api.model.KxsUser">
|
|
|
+ select ku.*
|
|
|
+ from kxs_leader kl
|
|
|
+ left join kxs_user ku on kl.user_id = ku.id
|
|
|
+ <where>
|
|
|
+ and kl.del_flag = 0
|
|
|
+ and kl.leader_type <= 2
|
|
|
+ and kl.user_id in
|
|
|
+ <foreach collection="pidPath" item="userId" open="(" separator="," close=")">
|
|
|
+ #{userId}
|
|
|
+ </foreach>
|
|
|
+ and kl.expired_date > NOW()
|
|
|
+ </where>
|
|
|
+ ORDER BY FIELD(kl.user_id, <foreach collection="pidPath" item="userId" separator=",">#{userId}</foreach>)
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|