提交修改
This commit is contained in:
@@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="shareUrl" column="share_url" />
|
||||
<result property="sharePass" column="share_pass" />
|
||||
<result property="pageImage" column="page_image" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
@@ -24,28 +25,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="type" column="type"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScadaVo">
|
||||
select id, guid, scada_data, serial_numbers, device_name, is_main_page, page_name, page_resolution, is_share, share_url, share_pass, page_image, tenant_id, tenant_name, create_by, create_time, update_by, update_time, del_flag from scada
|
||||
select id, guid, scada_data, serial_numbers, device_name, is_main_page, page_name, page_resolution, is_share, share_url, share_pass, page_image, dept_id,tenant_id, tenant_name, create_by, create_time, update_by, update_time, del_flag, type from scada
|
||||
</sql>
|
||||
|
||||
<select id="selectScadaList" parameterType="Scada" resultMap="ScadaResult">
|
||||
<include refid="selectScadaVo"/>
|
||||
select s.id, s.guid, s.scada_data, s.serial_numbers, s.device_name, s.is_main_page, s.page_name, s.page_resolution, s.is_share, s.share_url, s.share_pass, s.page_image, s.dept_id, s.tenant_id, s.tenant_name, s.create_by, s.create_time, s.update_by, s.update_time, s.del_flag, s.type
|
||||
from scada s
|
||||
<where>
|
||||
<if test="guid != null and guid != ''"> and guid = #{guid}</if>
|
||||
<if test="scadaData != null and scadaData != ''"> and scada_data = #{scadaData}</if>
|
||||
<if test="serialNumbers != null and serialNumbers != ''"> and serial_numbers = #{serialNumbers}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="isMainPage != null "> and is_main_page = #{isMainPage}</if>
|
||||
<if test="pageName != null and pageName != ''"> and page_name like concat('%', #{pageName}, '%')</if>
|
||||
<if test="pageResolution != null and pageResolution != ''"> and page_resolution = #{pageResolution}</if>
|
||||
<if test="isShare != null "> and is_share = #{isShare}</if>
|
||||
<if test="shareUrl != null and shareUrl != ''"> and share_url = #{shareUrl}</if>
|
||||
<if test="sharePass != null and sharePass != ''"> and share_pass = #{sharePass}</if>
|
||||
<if test="pageImage != null and pageImage != ''"> and page_image = #{pageImage}</if>
|
||||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
||||
<if test="tenantName != null and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>
|
||||
<if test="guid != null and guid != ''"> and s.guid = #{guid}</if>
|
||||
<if test="scadaData != null and scadaData != ''"> and s.scada_data = #{scadaData}</if>
|
||||
<if test="serialNumbers != null and serialNumbers != ''"> and s.serial_numbers = #{serialNumbers}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and s.device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="isMainPage != null "> and s.is_main_page = #{isMainPage}</if>
|
||||
<if test="pageName != null and pageName != ''"> and s.page_name like concat('%', #{pageName}, '%')</if>
|
||||
<if test="pageResolution != null and pageResolution != ''"> and s.page_resolution = #{pageResolution}</if>
|
||||
<if test="isShare != null "> and s.is_share = #{isShare}</if>
|
||||
<if test="shareUrl != null and shareUrl != ''"> and s.share_url = #{shareUrl}</if>
|
||||
<if test="sharePass != null and sharePass != ''"> and s.share_pass = #{sharePass}</if>
|
||||
<if test="pageImage != null and pageImage != ''"> and s.page_image = #{pageImage}</if>
|
||||
<if test="deptId != null ">
|
||||
and ( s.dept_id in (SELECT de.dept_id FROM sys_dept de
|
||||
WHERE FIND_IN_SET(#{deptId}, de.ancestors) OR de.dept_id = #{deptId})
|
||||
)
|
||||
</if>
|
||||
<!-- <if test="tenantName != null and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>-->
|
||||
<if test="type != null">and s.type = #{type}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -74,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<where>
|
||||
<if test="userId != null and userId != 0"> and u.user_id = #{userId}</if>
|
||||
<if test="tenantId != null and tenantId != 0"> and d.tenant_id = #{tenantId}</if>
|
||||
|
||||
</where>
|
||||
) as deviceCount,
|
||||
|
||||
@@ -216,6 +225,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="shareUrl != null">share_url,</if>
|
||||
<if test="sharePass != null">share_pass,</if>
|
||||
<if test="pageImage != null">page_image,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null">tenant_name,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
@@ -224,6 +234,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="type != null">type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="guid != null">#{guid},</if>
|
||||
@@ -237,6 +248,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="shareUrl != null">#{shareUrl},</if>
|
||||
<if test="sharePass != null">#{sharePass},</if>
|
||||
<if test="pageImage != null">#{pageImage},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null">#{tenantName},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
@@ -245,6 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -262,6 +275,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="shareUrl != null">share_url = #{shareUrl},</if>
|
||||
<if test="sharePass != null">share_pass = #{sharePass},</if>
|
||||
<if test="pageImage != null">page_image = #{pageImage},</if>
|
||||
<if test="deptId != null ">dept_id = #{deptId},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null">tenant_name = #{tenantName},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
@@ -270,6 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@@ -278,10 +293,79 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
delete from scada where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScadaByGuid" parameterType="String">
|
||||
delete from scada where guid = #{guid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScadaByIds" parameterType="String">
|
||||
delete from scada where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectUserIdByDeptId" resultType="java.lang.Long">
|
||||
select user_id
|
||||
from sys_user
|
||||
where dept_id = #{deptId}
|
||||
and status = 0
|
||||
and del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectGuidByProductId" resultType="java.lang.String">
|
||||
select p.guid from iot_product p
|
||||
where p.product_id = #{productId}
|
||||
and p.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectGuidBySceneModelId" resultType="java.lang.String">
|
||||
select guid
|
||||
from scene_model
|
||||
where scene_model_id = #{sceneModelId}
|
||||
and del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectProductByGuid" resultType="java.lang.Long">
|
||||
select product_id
|
||||
from iot_product
|
||||
where guid = #{guid}
|
||||
and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectSceneModelByGuid" resultType="java.lang.Long">
|
||||
select scene_model_id
|
||||
from scene_model
|
||||
where guid = #{guid}
|
||||
and del_flag = 0
|
||||
</select>
|
||||
|
||||
<update id="updateProductGuid">
|
||||
update iot_product
|
||||
set guid = #{guid}
|
||||
where product_id = #{productId}
|
||||
</update>
|
||||
|
||||
<update id="updateSceneModelGuid">
|
||||
update scene_model
|
||||
set guid = #{guid}
|
||||
where scene_model_id = #{sceneModelId}
|
||||
</update>
|
||||
|
||||
<update id="deleteSceneModelByGuids">
|
||||
update scene_model
|
||||
set guid = null
|
||||
where guid in
|
||||
<foreach collection="guids" item="guid" open="(" separator="," close=")">
|
||||
#{guid}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deleteProductByGuids">
|
||||
update iot_product
|
||||
set guid = null
|
||||
where guid in
|
||||
<foreach collection="guids" item="guid" open="(" separator="," close=")">
|
||||
#{guid}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user