@Select
@Select("select * from file_info t where t.id = #{id}")
FileInfo getById(String id);
@Insert
@Insert("insert into file_info(id, contentType, size, path, url, type, createTime, updateTime) values(#{id}, #{contentType}, #{size}, #{path}, #{url}, #{type}, now(), now())")
int save(FileInfo fileInfo);
//@Options 启用自增主键
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into t_dict(type, k, val, createTime, updateTime) values(#{type}, #{k}, #{val}, now(), now())")
int save(Dict dict);
insert ignore 的前提是主键或索引,如果存在就不插入了
@Insert("insert ignore into t_notice_read(noticeId, userId, createTime) values(#{noticeId}, #{userId}, now())")
int saveReadRecord(@Param("noticeId") Long noticeId, @Param("userId") Long userId);
@Delete
@Delete("delete from file_info where id = #{id}")
int delete(String id);
@Update
@Update("update file_info t set t.updateTime = now() where t.id = #{id}")
int update(FileInfo fileInfo);