MonitorReportWeeksMapper.xml 5.7 KB
<?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.web.controller.monitorReportWeeks.mapper.MonitorReportWeeksMapper">
    
    <resultMap type="MonitorReportWeeks" id="MonitorReportWeeksResult">
        <result property="id"    column="id"    />
        <result property="userId"    column="user_id"    />
        <result property="executeDate"    column="execute_date"    />
        <result property="highRisk"    column="high_risk"    />
        <result property="mediumRisk"    column="medium_risk"    />
        <result property="warning"    column="warning"    />
        <result property="reminder"    column="reminder"    />
        <result property="dataJson"    column="data_json"    />
        <result property="createDate"    column="create_date"    />
        <result property="createBy"    column="create_by"    />
        <result property="typeJson"    column="type_json"    />
        <result property="changeJson"    column="change_json"    />
        <result property="countJson"    column="count_json"    />
    </resultMap>
	
	<sql id="selectMonitorReportWeeksVo">
        select id, user_id, execute_date, high_risk, medium_risk, warning, reminder, data_json, create_date, create_by,type_json,change_json,count_json from monitor_report_weeks
    </sql>
	
    <select id="selectMonitorReportWeeksList" parameterType="MonitorReportWeeks" resultMap="MonitorReportWeeksResult">
        <include refid="selectMonitorReportWeeksVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="userId != null "> and user_id = #{userId}</if>
            <if test="executeDate != null  and executeDate != '' "> and execute_date = #{executeDate}</if>
            <if test="highRisk != null "> and high_risk = #{highRisk}</if>
            <if test="mediumRisk != null "> and medium_risk = #{mediumRisk}</if>
            <if test="warning != null "> and warning = #{warning}</if>
            <if test="reminder != null "> and reminder = #{reminder}</if>
            <if test="dataJson != null  and dataJson != '' "> and data_json = #{dataJson}</if>
            <if test="createDate != null "> and create_date = #{createDate}</if>
            <if test="createBy != null  and createBy != '' "> and create_by = #{createBy}</if>
        </where>
    </select>
    
    <select id="selectMonitorReportWeeksById" parameterType="Integer" resultMap="MonitorReportWeeksResult">
        <include refid="selectMonitorReportWeeksVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertMonitorReportWeeks" parameterType="MonitorReportWeeks" useGeneratedKeys="true" keyProperty="id">
        insert into monitor_report_weeks
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="userId != null  ">user_id,</if>
			<if test="executeDate != null  and executeDate != ''  ">execute_date,</if>
			<if test="highRisk != null  ">high_risk,</if>
			<if test="mediumRisk != null  ">medium_risk,</if>
			<if test="warning != null  ">warning,</if>
			<if test="reminder != null  ">reminder,</if>
			<if test="dataJson != null  and dataJson != ''  ">data_json,</if>
			<if test="createDate != null  ">create_date,</if>
			<if test="createBy != null  and createBy != ''  ">create_by,</if>
			<if test="typeJson != null  and typeJson != ''  ">type_json,</if>
            <if test="changeJson != null  and changeJson != ''  ">change_json,</if>
            <if test="countJson != null  and countJson != ''  ">count_json,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="userId != null  ">#{userId},</if>
			<if test="executeDate != null  and executeDate != ''  ">#{executeDate},</if>
			<if test="highRisk != null  ">#{highRisk},</if>
			<if test="mediumRisk != null  ">#{mediumRisk},</if>
			<if test="warning != null  ">#{warning},</if>
			<if test="reminder != null  ">#{reminder},</if>
			<if test="dataJson != null  and dataJson != ''  ">#{dataJson},</if>
			<if test="createDate != null  ">#{createDate},</if>
			<if test="createBy != null  and createBy != ''  ">#{createBy},</if>
			<if test="typeJson != null  and typeJson != ''  ">#{typeJson},</if>
            <if test="changeJson != null  and changeJson != ''  ">#{changeJson},</if>
            <if test="countJson != null  and countJson != ''  ">#{countJson},</if>
         </trim>
    </insert>
	 
    <update id="updateMonitorReportWeeks" parameterType="MonitorReportWeeks">
        update monitor_report_weeks
        <trim prefix="SET" suffixOverrides=",">
            <if test="userId != null  ">user_id = #{userId},</if>
            <if test="executeDate != null  and executeDate != ''  ">execute_date = #{executeDate},</if>
            <if test="highRisk != null  ">high_risk = #{highRisk},</if>
            <if test="mediumRisk != null  ">medium_risk = #{mediumRisk},</if>
            <if test="warning != null  ">warning = #{warning},</if>
            <if test="reminder != null  ">reminder = #{reminder},</if>
            <if test="dataJson != null  and dataJson != ''  ">data_json = #{dataJson},</if>
            <if test="createDate != null  ">create_date = #{createDate},</if>
            <if test="createBy != null  and createBy != ''  ">create_by = #{createBy},</if>
        </trim>
        where id = #{id}
    </update>

	<delete id="deleteMonitorReportWeeksById" parameterType="Integer">
        delete from monitor_report_weeks where id = #{id}
    </delete>
	
    <delete id="deleteMonitorReportWeeksByIds" parameterType="String">
        delete from monitor_report_weeks where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>