package thyyxxk.webserver.dao.his.technologyArchives;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import thyyxxk.webserver.entity.technologyArchives.TechnologyArchivesHL2;

import java.util.List;

@Mapper
public interface TechnologyArchivesHL2Dao extends BaseMapper<TechnologyArchivesHL2> {

    @Select(" select * from technology_archives_hl2 where social_no = #{socialNo} and id = #{id} ")
    TechnologyArchivesHL2 selectTechnologyArchivesHL2ById(@Param("socialNo") String socialNo, @Param("id") Integer id);

    @Select(" select isnull(max(id), 0) as id from technology_archives_hl2 where social_no = #{socialNo} ")
    int selectTechnologyArchivesHL2MaxId(@Param("socialNo") String socialNo);

    @Update(" delete from technology_archives_hl2 where social_no = #{socialNo} and id = #{id} ")
    int delTechnologyArchivesHL2ByCode(@Param("socialNo") String socialNo, @Param("id") Integer id);

}
