<?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.mcwl.communityCenter.mapper.PublishCommentLikeMapper">
    <update id="updateDelFlagById">
        update cc_publish_comment_like
        set del_flag = #{publishCommentLike.delFlag}
        where tenant_id = #{publishCommentLike.tenantId}
        and community_id = #{publishCommentLike.communityId}
        and comment_id = #{publishCommentLike.publishCommentId}
    </update>

    <select id="selectByTenantIdAndCommunityIdAndCommentId"
            resultType="com.mcwl.communityCenter.domain.PublishCommentLike">
        select * from cc_publish_comment_like
        where tenant_id = #{tenantId}
        and community_id = #{communityId}
        and comment_id = #{commentId}
    </select>
    <select id="selectLike" resultType="com.mcwl.communityCenter.domain.PublishCommentLike">
        select * from cc_publish_comment_like
        where tenant_id = #{publishCommentLikeRes.tenantId}
        and community_id = #{publishCommentLikeRes.communityId}
        and publish_id = #{publishCommentLikeRes.publishId}
        and comment_id = #{publishCommentLikeRes.commentId}
        and user_id = #{userId}
    </select>
</mapper>