<?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.resource.mapper.ModelLikeMapper">
    <update id="updateDelFlagById">
        update model_like
        set del_flag = #{delFlag}
        where user_id = #{userId} and model_id = #{modelId}
    </update>


    <select id="getLike" resultType="com.mcwl.resource.domain.ModelLike">
        select id,
               user_id,
               model_id,
               create_by,
               create_time,
               update_by,
               update_time,
               del_flag,
               remark
        from model_like
        where user_id = #{userId} and model_id = #{modelId}
    </select>

    <select id="selectModelLikeById" resultType="com.mcwl.resource.domain.WorkFlowLike">
        select * from model_like where user_id = #{userId} and model_id = #{id} and del_flag = 0
    </select>
</mapper>
