<?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.sqx.modules.shop.dao.ShopMessageDao">

    <update id="updateAuditReasonIsNull">
        update goods_shop set audit_time = null, audit_reason = null where shop_id = #{shopId}
    </update>

    <select id="selectShopAuthentication" resultType="com.sqx.modules.goods.entity.GoodsShop">
        select gs.*, st.shop_type_name as shopTypeName from goods_shop gs left join shop_type st on gs.shop_type_id = st.id where phone = #{phone}
    </select>

    <insert id="userFeedback">
        insert into sys_feedback (feedback_type, shop_id, user_email, feedback_score, feedback_message, feedback_time)
        values
        (2, #{shopId}, #{userEmail}, #{feedbackScore}, #{feedbackMessage}, #{format})
    </insert>

    <select id="selectShopByUserId" resultType="com.sqx.modules.goods.entity.GoodsShop">
        select gs.*, st.shop_type_name as shopTypeName
        from goods_shop gs left join shop_type st on gs.shop_type_id = st.id where gs.user_id = #{userId}
    </select>

</mapper>