RuoYi-Vue/xkt/src/main/resources/mapper/StoreMapper.xml

73 lines
2.2 KiB
XML

<?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.ruoyi.xkt.mapper.StoreMapper">
<select id="selectStorePage" resultType="com.ruoyi.xkt.dto.store.StorePageResDTO">
SELECT
s.id AS storeId,
s.store_name,
u.user_name,
s.contact_phone,
s.contact_back_phone,
s.store_status,
s.del_flag,
s.store_weight,
s.service_amount,
s.member_amount
FROM
store s JOIN sys_user u ON s.user_id = u.user_id
<if test="storeName != null and storeName != ''"> and s.store_name like concat('%', #{storeName}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and s.del_flag = #{delFlag}</if>
<if test="storeStatus != null and storeStatus != ''"> and s.store_status = #{storeStatus}</if>
</select>
<select id="getSimpleInfo" resultType="com.ruoyi.xkt.dto.store.StoreSimpleResDTO">
SELECT DISTINCT
s.id AS store_id,
s.store_name,
s.template_num,
s.contact_phone,
s.contact_back_phone,
s.wechat_account,
s.qq_account,
s.store_address,
sc.legal_name,
sc.license_name,
s.store_logo_id,
s.stock_sys,
s.store_status,
s.service_end_time
FROM
store s JOIN store_certificate sc ON s.id = sc.store_id
WHERE
s.id = #{storeId}
</select>
<select id="selectTop10AppViewCount">
SELECT
s.id AS storeId,
s.store_name,
sf.file_url AS logo,
s.view_count
FROM
store s
LEFT JOIN sys_file sf ON s.store_logo_id = sf.id
WHERE
s.del_flag = 0
ORDER BY
s.view_count DESC
LIMIT 10
</select>
<update id="updateServiceAmountNull">
UPDATE store SET service_amount = null WHERE id = #{storeId}
</update>
<update id="updateMemberAmountNull">
UPDATE store SET member_amount = null WHERE id = #{storeId}
</update>
</mapper>