<?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.ruoyi.interchange.mapper.TbDataRulesMapper">
|
|
<resultMap type="TbDataRules" id="TbDataRulesResult">
|
<result property="id" column="id" />
|
<result property="systemId" column="system_id" />
|
<result property="dataName" column="data_name" />
|
<result property="coalMineCode" column="coal_mine_code" />
|
<result property="dataCode" column="data_code" />
|
<result property="dataTypeCode" column="data_type_code" />
|
<result property="cycle" column="cycle" />
|
<result property="cycleDescription" column="cycle_description" />
|
<result property="encryption" column="encryption" />
|
<result property="receiveUrl" column="receive_url" />
|
<result property="lastTime" column="last_time" />
|
<result property="checkFlag" column="check_flag" />
|
<result property="checkHead" column="check_head" />
|
<result property="checkTitle" column="check_title" />
|
</resultMap>
|
|
<sql id="selectTbDataRulesVo">
|
select id, system_id, data_name, coal_mine_code, data_code, data_type_code, cycle, cycle_description, encryption, receive_url, last_time, check_flag,check_head,check_title from tb_data_rules
|
</sql>
|
|
<select id="selectTbDataRulesList" parameterType="TbDataRules" resultMap="TbDataRulesResult">
|
<include refid="selectTbDataRulesVo"/>
|
<where>
|
<if test="systemId != null "> and system_id = #{systemId}</if>
|
<if test="dataName != null and dataName != ''"> and data_name like concat('%', #{dataName}, '%')</if>
|
<if test="coalMineCode != null and coalMineCode != ''"> and coal_mine_code = #{coalMineCode}</if>
|
<if test="dataCode != null and dataCode != ''"> and data_code = #{dataCode}</if>
|
<if test="dataTypeCode != null and dataTypeCode != ''"> and data_type_code = #{dataTypeCode}</if>
|
<if test="cycle != null "> and cycle = #{cycle}</if>
|
<if test="cycleDescription != null and cycleDescription != ''"> and cycle_description = #{cycleDescription}</if>
|
<if test="encryption != null and encryption != ''"> and encryption = #{encryption}</if>
|
<if test="receiveUrl != null and receiveUrl != ''"> and receive_url = #{receiveUrl}</if>
|
<if test="lastTime != null "> and last_time = #{lastTime}</if>
|
<if test="checkFlag != null and checkFlag != ''"> and check_flag = #{checkFlag}</if>
|
<if test="checkHead != null and checkHead != ''"> and check_head = #{checkHead}</if>
|
<if test="checkTitle != null and checkTitle != ''"> and check_title = #{checkTitle}</if>
|
</where>
|
</select>
|
|
<select id="selectTbDataRulesById" parameterType="Long" resultMap="TbDataRulesResult">
|
<include refid="selectTbDataRulesVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertTbDataRules" parameterType="TbDataRules" useGeneratedKeys="true" keyProperty="id">
|
insert into tb_data_rules
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="systemId != null">system_id,</if>
|
<if test="dataName != null">data_name,</if>
|
<if test="coalMineCode != null">coal_mine_code,</if>
|
<if test="dataCode != null">data_code,</if>
|
<if test="dataTypeCode != null">data_type_code,</if>
|
<if test="cycle != null">cycle,</if>
|
<if test="cycleDescription != null">cycle_description,</if>
|
<if test="encryption != null">encryption,</if>
|
<if test="receiveUrl != null">receive_url,</if>
|
<if test="lastTime != null">last_time,</if>
|
<if test="checkFlag != null">check_flag,</if>
|
<if test="checkHead != null">check_head,</if>
|
<if test="checkTitle != null">check_title,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="systemId != null">#{systemId},</if>
|
<if test="dataName != null">#{dataName},</if>
|
<if test="coalMineCode != null">#{coalMineCode},</if>
|
<if test="dataCode != null">#{dataCode},</if>
|
<if test="dataTypeCode != null">#{dataTypeCode},</if>
|
<if test="cycle != null">#{cycle},</if>
|
<if test="cycleDescription != null">#{cycleDescription},</if>
|
<if test="encryption != null">#{encryption},</if>
|
<if test="receiveUrl != null">#{receiveUrl},</if>
|
<if test="lastTime != null">#{lastTime},</if>
|
<if test="checkFlag != null">#{checkFlag},</if>
|
<if test="checkHead != null">#{checkHead},</if>
|
<if test="checkTitle != null">#{checkTitle},</if>
|
</trim>
|
</insert>
|
|
<update id="updateTbDataRules" parameterType="TbDataRules">
|
update tb_data_rules
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="systemId != null">system_id = #{systemId},</if>
|
<if test="dataName != null">data_name = #{dataName},</if>
|
<if test="coalMineCode != null">coal_mine_code = #{coalMineCode},</if>
|
<if test="dataCode != null">data_code = #{dataCode},</if>
|
<if test="dataTypeCode != null">data_type_code = #{dataTypeCode},</if>
|
<if test="cycle != null">cycle = #{cycle},</if>
|
<if test="cycleDescription != null">cycle_description = #{cycleDescription},</if>
|
<if test="encryption != null">encryption = #{encryption},</if>
|
<if test="receiveUrl != null">receive_url = #{receiveUrl},</if>
|
<if test="lastTime != null">last_time = #{lastTime},</if>
|
<if test="checkFlag != null">check_flag = #{checkFlag},</if>
|
<if test="checkHead != null">check_head = #{checkHead},</if>
|
<if test="checkTitle != null">check_title = #{checkTitle},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteTbDataRulesById" parameterType="Long">
|
delete from tb_data_rules where id = #{id}
|
</delete>
|
|
<delete id="deleteTbDataRulesByIds" parameterType="String">
|
delete from tb_data_rules where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<select id="selectTbDataRulesByDataName" parameterType="String" resultMap="TbDataRulesResult">
|
<include refid="selectTbDataRulesVo"/>
|
where data_name = #{dataName}
|
</select>
|
</mapper>
|