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

import java.util.Map;

@Mapper
public interface TechnologyArchives13Dao extends BaseMapper<TechnologyArchives13> {

    @Select(" select * from technology_archives13 where social_no = #{socialNo} and id = #{id} ")
    TechnologyArchives13 selectTechnologyArchives13ById(@Param("socialNo") String socialNo, @Param("id") Integer id);

    @Select(" select image  from  technology_archives13 where social_no = #{socialNo} and name = #{name}")
    Map<String, Object> selectAppointmentImage(@Param("socialNo") String socialNo, @Param("name") String name);

    @Update(" update technology_archives13 set image = #{url} where social_no = #{socialNo} and name = #{name} ")
    int updateAppointmentImage(String url,@Param("socialNo") String socialNo,@Param("name") String name);

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

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

}
