2024-08-14 01:13:37 +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.yanzhu.jh.device.mapper.ProjectPitMonitCfgMapper">
|
|
|
|
|
2024-08-17 13:03:00 +08:00
|
|
|
<resultMap type="ProjectPitMonitCfg" id="ProjectPitMonitCfgResult">
|
2024-08-14 01:13:37 +08:00
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="projectId" column="project_id" />
|
|
|
|
<result property="subDeptId" column="sub_dept_id" />
|
|
|
|
<result property="vendorCode" column="vendor_code" />
|
|
|
|
<result property="vendorParamter" column="vendor_paramter" />
|
|
|
|
<result property="enabled" column="enabled" />
|
|
|
|
<result property="state" column="state" />
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
<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" />
|
2024-08-18 23:16:21 +08:00
|
|
|
<result property="projectName" column="projectName"/>
|
|
|
|
<result property="deptName" column="deptName"/>
|
2024-08-14 01:13:37 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectSurProjectPitMonitCfgVo">
|
2024-08-18 23:16:21 +08:00
|
|
|
|
|
|
|
select id, project_id, sub_dept_id, vendor_code, vendor_paramter, enabled, state, remark, is_del, create_by, create_time, update_by, update_time,projectName,deptName
|
|
|
|
from (
|
|
|
|
|
|
|
|
select a.*,p.projectName,b.unitName as deptName
|
|
|
|
from sur_project_pit_monit_cfg a
|
|
|
|
JOIN sur_project p on a.project_id =p.id
|
|
|
|
join sur_project_unit_info b on a.sub_dept_id=b.unitId and a.project_id=b.projectId ) sur_project_pit_monit_cfg
|
|
|
|
|
2024-08-14 01:13:37 +08:00
|
|
|
</sql>
|
|
|
|
|
2024-08-17 13:03:00 +08:00
|
|
|
<select id="selectSurProjectPitMonitCfgList" parameterType="SurProjectPitMonitCfg" resultMap="ProjectPitMonitCfgResult">
|
2024-08-14 01:13:37 +08:00
|
|
|
<include refid="selectSurProjectPitMonitCfgVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="projectId != null "> and project_id = #{projectId}</if>
|
|
|
|
<if test="subDeptId != null "> and sub_dept_id = #{subDeptId}</if>
|
|
|
|
<if test="vendorCode != null and vendorCode != ''"> and vendor_code = #{vendorCode}</if>
|
|
|
|
<if test="vendorParamter != null and vendorParamter != ''"> and vendor_paramter = #{vendorParamter}</if>
|
|
|
|
<if test="enabled != null "> and enabled = #{enabled}</if>
|
|
|
|
<if test="state != null "> and state = #{state}</if>
|
|
|
|
<if test="isDel != null "> and is_del = #{isDel}</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
2024-08-17 13:03:00 +08:00
|
|
|
<select id="selectSurProjectPitMonitCfgById" parameterType="Long" resultMap="ProjectPitMonitCfgResult">
|
2024-08-14 01:13:37 +08:00
|
|
|
<include refid="selectSurProjectPitMonitCfgVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertSurProjectPitMonitCfg" parameterType="SurProjectPitMonitCfg" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into sur_project_pit_monit_cfg
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="projectId != null">project_id,</if>
|
|
|
|
<if test="subDeptId != null">sub_dept_id,</if>
|
|
|
|
<if test="vendorCode != null">vendor_code,</if>
|
|
|
|
<if test="vendorParamter != null">vendor_paramter,</if>
|
|
|
|
<if test="enabled != null">enabled,</if>
|
|
|
|
<if test="state != null">state,</if>
|
|
|
|
<if test="remark != null">remark,</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>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="projectId != null">#{projectId},</if>
|
|
|
|
<if test="subDeptId != null">#{subDeptId},</if>
|
|
|
|
<if test="vendorCode != null">#{vendorCode},</if>
|
|
|
|
<if test="vendorParamter != null">#{vendorParamter},</if>
|
|
|
|
<if test="enabled != null">#{enabled},</if>
|
|
|
|
<if test="state != null">#{state},</if>
|
|
|
|
<if test="remark != null">#{remark},</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>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateSurProjectPitMonitCfg" parameterType="ProjectPitMonitCfg">
|
|
|
|
update sur_project_pit_monit_cfg
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
|
|
|
<if test="subDeptId != null">sub_dept_id = #{subDeptId},</if>
|
|
|
|
<if test="vendorCode != null">vendor_code = #{vendorCode},</if>
|
|
|
|
<if test="vendorParamter != null">vendor_paramter = #{vendorParamter},</if>
|
|
|
|
<if test="enabled != null">enabled = #{enabled},</if>
|
|
|
|
<if test="state != null">state = #{state},</if>
|
|
|
|
<if test="remark != null">remark = #{remark},</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>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteSurProjectPitMonitCfgById" parameterType="Long">
|
|
|
|
delete from sur_project_pit_monit_cfg where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteSurProjectPitMonitCfgByIds" parameterType="String">
|
|
|
|
delete from sur_project_pit_monit_cfg where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|