mkl_cas_ja/ruoyi-yanzhu/src/main/resources/mapper/system/DevTowerProjectConfigMapper...

176 lines
10 KiB
XML

<?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.yanzhu.xd.system.mapper.DevTowerProjectConfigMapper">
<resultMap type="DevTowerProjectConfig" id="DevTowerProjectConfigResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="projectName" column="projectName" />
<result property="deviceSn" column="device_sn" />
<result property="deviceName" column="device_name" />
<result property="deviceSource" column="device_source" />
<result property="towerId" column="tower_id" />
<result property="towerType" column="tower_type" />
<result property="coordinateX" column="coordinate_x" />
<result property="coordinateY" column="coordinate_y" />
<result property="frontBrachium" column="front_brachium" />
<result property="afterBrachium" column="after_brachium" />
<result property="towerBodyHeight" column="tower_body_height" />
<result property="towerCapHeight" column="tower_cap_height" />
<result property="towerSectionHeight" column="tower_section_height" />
<result property="online" column="online" />
<result property="driName" column="dri_name" />
<result property="driPhone" column="dri_phone" />
<result property="safName" column="saf_name" />
<result property="safPhone" column="saf_phone" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectDevTowerProjectConfigVo">
select dtpc.id, dtpc.project_id, sp.projectName, dtpc.device_sn, dtpc.device_name, dtpc.device_source, dtpc.tower_id, dtpc.tower_type, dtpc.coordinate_x, dtpc.coordinate_y, dtpc.front_brachium, dtpc.after_brachium, dtpc.tower_body_height, dtpc.tower_cap_height, dtpc.tower_section_height, dtpc.online, dtpc.dri_name, dtpc.dri_phone, dtpc.saf_name, dtpc.saf_phone, dtpc.is_del, dtpc.create_by, dtpc.create_time, dtpc.update_by, dtpc.update_time, dtpc.remark from dev_tower_project_config dtpc
left join sur_project sp on sp.id = dtpc.project_id
</sql>
<select id="selectDevTowerProjectConfigList" parameterType="DevTowerProjectConfig" resultMap="DevTowerProjectConfigResult">
<include refid="selectDevTowerProjectConfigVo"/>
<where>
<if test="projectId != null "> and dtpc.project_id = #{projectId}</if>
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
<if test="deviceSn != null and deviceSn != ''"> and dtpc.device_sn = #{deviceSn}</if>
<if test="deviceName != null and deviceName != ''"> and dtpc.device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceSource != null and deviceSource != ''"> and dtpc.device_source = #{deviceSource}</if>
<if test="towerId != null and towerId != ''"> and dtpc.tower_id = #{towerId}</if>
<if test="towerType != null and towerType != ''"> and dtpc.tower_type = #{towerType}</if>
<if test="isDel != null "> and dtpc.is_del = #{isDel}</if>
</where>
order by dtpc.id desc
</select>
<select id="selectDevTowerProjectConfigById" parameterType="Long" resultMap="DevTowerProjectConfigResult">
<include refid="selectDevTowerProjectConfigVo"/>
where dtpc.id = #{id}
</select>
<select id="selectDevTowerProjectConfigBySn" parameterType="String" resultMap="DevTowerProjectConfigResult">
<include refid="selectDevTowerProjectConfigVo"/>
where dtpc.device_sn = #{sn} and dtpc.is_del = '0'
</select>
<insert id="insertDevTowerProjectConfig" parameterType="DevTowerProjectConfig" useGeneratedKeys="true" keyProperty="id">
insert into dev_tower_project_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectId != null">project_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="deviceSn != null">device_sn,</if>
<if test="deviceName != null">device_name,</if>
<if test="deviceSource != null">device_source,</if>
<if test="towerType != null">tower_type,</if>
<if test="towerId != null">tower_id,</if>
<if test="coordinateX != null">coordinate_x,</if>
<if test="coordinateY != null">coordinate_y,</if>
<if test="frontBrachium != null">front_brachium,</if>
<if test="afterBrachium != null">after_brachium,</if>
<if test="towerBodyHeight != null">tower_body_height,</if>
<if test="towerCapHeight != null">tower_cap_height,</if>
<if test="towerSectionHeight != null">tower_section_height,</if>
<if test="online != null">online,</if>
<if test="driName != null">dri_name,</if>
<if test="driPhone != null">dri_phone,</if>
<if test="safName != null">saf_name,</if>
<if test="safPhone != null">saf_phone,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectId != null">#{projectId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="deviceSn != null">#{deviceSn},</if>
<if test="deviceName != null">#{deviceName},</if>
<if test="deviceSource != null">#{deviceSource},</if>
<if test="towerType != null">#{towerType},</if>
<if test="towerId != null">#{towerId},</if>
<if test="coordinateX != null">#{coordinateX},</if>
<if test="coordinateY != null">#{coordinateY},</if>
<if test="frontBrachium != null">#{frontBrachium},</if>
<if test="afterBrachium != null">#{afterBrachium},</if>
<if test="towerBodyHeight != null">#{towerBodyHeight},</if>
<if test="towerCapHeight != null">#{towerCapHeight},</if>
<if test="towerSectionHeight != null">#{towerSectionHeight},</if>
<if test="online != null">#{online},</if>
<if test="driName != null">#{driName},</if>
<if test="driPhone != null">#{driPhone},</if>
<if test="safName != null">#{safName},</if>
<if test="safPhone != null">#{safPhone},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateDevTowerProjectConfig" parameterType="DevTowerProjectConfig">
update dev_tower_project_config
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="deviceSn != null">device_sn = #{deviceSn},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceSource != null">device_source = #{deviceSource},</if>
<if test="towerType != null">tower_type = #{towerType},</if>
<if test="towerId != null">tower_id = #{towerId},</if>
<if test="coordinateX != null">coordinate_x = #{coordinateX},</if>
<if test="coordinateY != null">coordinate_y = #{coordinateY},</if>
<if test="frontBrachium != null">front_brachium = #{frontBrachium},</if>
<if test="afterBrachium != null">after_brachium = #{afterBrachium},</if>
<if test="towerBodyHeight != null">tower_body_height = #{towerBodyHeight},</if>
<if test="towerCapHeight != null">tower_cap_height = #{towerCapHeight},</if>
<if test="towerSectionHeight != null">tower_section_height = #{towerSectionHeight},</if>
<if test="online != null">online = #{online},</if>
<if test="driName != null">dri_name = #{driName},</if>
<if test="driPhone != null">dri_phone = #{driPhone},</if>
<if test="safName != null">saf_name = #{safName},</if>
<if test="safPhone != null">saf_phone = #{safPhone},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<update id="deleteDevTowerProjectConfigById" parameterType="Long">
update dev_tower_project_config set is_del=1 where id = #{id}
</update>
<update id="deleteDevTowerProjectConfigByIds" parameterType="String">
update dev_tower_project_config set is_del=1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<select id="findtowerConfigGroupOnline" parameterType="DevTowerProjectConfig" resultType="Map">
select online, count(1) as total from dev_tower_project_config
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
</where>
group by online
</select>
</mapper>