gunshi-project-ss/src/main/resources/mapper/StCameraAreaBMapper.xml

50 lines
2.3 KiB
XML
Raw Normal View History

2024-01-24 14:27:40 +08:00
<?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.gunshi.project.xyt.mapper.StCameraAreaBMapper">
<resultMap id="BaseResultMap" type="com.gunshi.project.xyt.model.StCameraAreaB">
<!--@mbg.generated-->
<!--@Table dbo.ST_CAMERA_AREA_B-->
<id column="CAM_AR_ID" jdbcType="BIGINT" property="camArId" />
<result column="CAM_AR_NM" jdbcType="VARCHAR" property="camArNm" />
<result column="PID" jdbcType="BIGINT" property="pid" />
<result column="SORT_ON" jdbcType="INTEGER" property="sortOn" />
<result column="STATUS" jdbcType="INTEGER" property="status" />
<result column="COMMENTS" jdbcType="VARCHAR" property="comments" />
<result column="CREATE_TM" jdbcType="TIMESTAMP" property="createTm" />
<result column="TM" jdbcType="TIMESTAMP" property="tm" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
CAM_AR_ID, CAM_AR_NM, PID, SORT_ON, [STATUS], COMMENTS, CREATE_TM, TM
</sql>
<insert id="batchInsert" parameterType="map">
<!--@mbg.generated-->
insert into dbo.ST_CAMERA_AREA_B
(CAM_AR_ID, CAM_AR_NM, PID, SORT_ON, [STATUS], COMMENTS, CREATE_TM, TM)
values
<foreach collection="list" item="item" separator=",">
(#{item.camArId,jdbcType=BIGINT}, #{item.camArNm,jdbcType=VARCHAR}, #{item.pid,jdbcType=BIGINT},
#{item.sortOn,jdbcType=INTEGER}, #{item.status,jdbcType=INTEGER}, #{item.comments,jdbcType=VARCHAR},
#{item.createTm,jdbcType=TIMESTAMP}, #{item.tm,jdbcType=TIMESTAMP})
</foreach>
</insert>
2024-01-24 17:43:51 +08:00
<select id="queryStCameraAreaBList" resultType="com.gunshi.project.xyt.entity.basedata.StCameraAreaVo">
select t1.CAM_AR_ID, t1.CAM_AR_NM, t1.PID, t1.SORT_ON, t1.[STATUS], t1.COMMENTS, t1.CREATE_TM, t1.TM,
t2.CAM_AR_NM PID_NAME
from ST_CAMERA_AREA_B t1
left join ST_CAMERA_AREA_B t2 on t1.pid=t2.CAM_AR_ID
<where>
<if test="name!=null and name!=''">
t1.CAM_AR_NM like CONCAT('%',#{name},'%')
</if>
and t1.STATUS=1
</where>
</select>
<select id="queryStCameraAreaBTree" resultType="com.gunshi.project.xyt.entity.basedata.StCameraAreaTreeVo">
select
<include refid="Base_Column_List" />
from ST_CAMERA_AREA_B where STATUS=1 order by SORT_ON
</select>
2024-01-24 14:27:40 +08:00
</mapper>