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

import java.util.Map;

@Mapper
public interface TechnologyArchives9Dao extends BaseMapper<TechnologyArchives9> {

    @Select(" select * from technology_archives9 where social_no = #{socialNo} and id = #{id} ")
    TechnologyArchives9 selectTechnologyArchives9ById(@Param("socialNo") String socialNo, @Param("id") Integer id);

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

    @Update(" update technology_archives9 set image = #{url} where social_no = #{socialNo}   and time = #{time} ")
    int updateImage9(@Param("socialNo") String socialNo, @Param("time") String yime, String url);

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

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

}
