1234567891011121314151617181920212223242526272829303132 |
- package com.xiaoan.dao.backend;
- import com.xiaoan.domain.backend.CameraEntity;
- import com.xiaoan.domain.dto.response.CameraResponse;
- import org.apache.ibatis.annotations.Mapper;
- import org.apache.ibatis.annotations.Select;
- import org.springframework.stereotype.Component;
- import java.util.List;
- /**
- * Created by Hb_zzZ on 2020/2/27.
- */
- @Mapper
- @Component
- public interface CameraRepository extends IBaseMapper<CameraEntity, Long> {
- @Select(value = "select * from t_camera where wifi_name = #{code} and rec_status = 'A' ")
- CameraEntity findByWifiName(String code);
- @Select(value = "select z.id, z.sn_code, z.child_name, z.wifi_name, z.create_time, z.update_time, d.type from" +
- " t_camera z left join t_camera_detail d on z.id = d.camera_id where z.rec_status = 'A' " +
- " and ( z.wifi_name like #{searchKey} or #{searchKey} is null)" +
- " and (d.user_id = #{userId} or #{userId} is null) " +
- " order by z.create_time desc")
- List<CameraResponse> findAllBySearchKey(String searchKey, Long userId);
- }
|