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.TechnologyArchivesHL9;

import java.util.Map;

@Mapper
public interface TechnologyArchivesHL9Dao extends BaseMapper<TechnologyArchivesHL9> {

    @Select(" select * from technology_archives_hl9 where social_no = #{socialNo} and id = #{id} ")
    TechnologyArchivesHL9 selectTechnologyArchivesHL9ById(@Param("socialNo") String socialNo, @Param("id") Integer id);

    @Select(" select image  from  technology_archives_hl9 where social_no = #{socialNo} and id = #{id}")
    Map<String, Object> selectHL9Image(@Param("socialNo") String socialNo, @Param("id") Integer id);

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

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

}
