<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<mapper namespace="com.gkhy.safePlatform.account.repository.CameraRepository" >
|
|
<resultMap id="baseMap" type="com.gkhy.safePlatform.account.entity.device.Camera">
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
<result property="bizDepId" column="biz_dep_id" jdbcType="BIGINT"/>
|
<result property="deviceNo" column="device_no" jdbcType="VARCHAR"/>
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
<result property="shortName" column="short_name" jdbcType="VARCHAR"/>
|
</resultMap>
|
|
<select id="listCamerasByBizDepId" resultMap="baseMap">
|
select * from sys_camera where biz_dep_id = #{bizDepId}
|
</select>
|
|
<delete id="deleteCameraById">
|
delete from sys_camera where id = #{id}
|
</delete>
|
|
<select id="listCamerasByCondition" resultMap="baseMap" parameterType="com.gkhy.safePlatform.account.model.dto.req.CameraQuery">
|
select * from sys_camera
|
<where>
|
<if test="param.bizDepId != null and param.bizDepId > 0">
|
and biz_dep_id = #{param.bizDepId}
|
</if>
|
<if test="param.name != null and param.name != ''">
|
and name like concat("%",#{param.name},"%")
|
</if>
|
<if test="param.shortName != null and param.shortName != ''">
|
and short_name like concat("%",#{param.shortName},"%")
|
</if>
|
</where>
|
</select>
|
|
<select id="findByDeviceNo" resultMap="baseMap">
|
select * from sys_camera where device_no = #{deviceNo}
|
</select>
|
|
<select id="listCamerasByName" resultMap="baseMap">
|
select * from sys_camera where name = #{name}
|
</select>
|
|
<select id="listCamerasByShortName" resultMap="baseMap">
|
select * from sys_camera where short_name = #{shortName}
|
</select>
|
|
<select id="listAllCameras" resultMap="baseMap">
|
select * from sys_camera
|
</select>
|
|
<select id="listByCameraIdList" resultMap="baseMap">
|
select * from sys_camera
|
<where>
|
<if test="cameraIdList != null">
|
id in
|
<foreach collection="cameraIdList" item="id" open="(" close=")" separator=",">
|
#{id}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
|
</mapper>
|