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.
 
 

11 lines
561 B

<?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="cc.hiver.app.dao.mapper.ShopMapper">
<select id="findByUserId" resultType="cc.hiver.app.entity.Shop">
SELECT DISTINCT m.*
FROM t_shop m
LEFT JOIN t_shop_user um ON m.id = um.shop_id
WHERE m.status = 0 AND (um.user_id = #{userId} OR m.shop_owner_id = #{userId} OR m.shop_manger_id = #{userId})
ORDER BY m.defaulted DESC
</select>
</mapper>