package com.huiju.foyo.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huiju.foyo.model.TaCase;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 案例表  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2019-08-21
 */
@Mapper
public interface TaCaseMapper extends BaseMapper<TaCase> {

    @Update("update ta_case set like_num = IFNULL(like_num, 0) + #{num} where id = #{id}")
    int increase(@Param("id") Integer id,@Param("num") int num);

    List<TaCase> selectBrothers(@Param("id")Integer id, @Param("type")String type);
}
