123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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.welampiot.dao.PlcPolicyCmdDao">
-
- <insert id="addPlcPolicyCmdZeroType" parameterType="PlcPolicyCmdDTO" keyProperty="id" useGeneratedKeys="true">
- insert into plc_policy_cmd(plc_policy_id, policyType, base_time_type,
- <if test="startTime1 != null and startTime1 != ''">
- starttime1, bright1, color1,
- </if>
- <if test="endTime1 != null and endTime1 != ''">
- endtime1, end_bright1, end_color1,
- </if>
- <if test="startTime2 != null and startTime2 != ''">
- starttime2, bright2, color2,
- </if>
- <if test="endTime2 != null and endTime2 != ''">
- endtime2, end_bright2, end_color2,
- </if>
- <if test="startTime3 != null and startTime3 != ''">
- starttime3, bright3, color3,
- </if>
- <if test="endTime3 != null and endTime3 != ''">
- endtime3, end_bright3, end_color3,
- </if>
- <if test="startTime4 != null and startTime4 != ''">
- starttime4, bright4, color4,
- </if>
- <if test="endTime4 != null and endTime4 != ''">
- endtime4, end_bright4, end_color4,
- </if>
- <if test="startTime5 != null and startTime5 != ''">
- starttime5, bright5, color5,
- </if>
- <if test="endTime5 != null and endTime5 != ''">
- endtime5, end_bright5, end_color5,
- </if>
- <if test="startTime6 != null and startTime6 != ''">
- starttime6, bright6, color6,
- </if>
- <if test="endTime6 != null and endTime6 != ''">
- endtime6, end_bright6, end_color6,
- </if>
- <if test="weekly != null">
- weekly,
- </if>
- lighter_mask)
- values (#{plcPolicyId},#{policyType},#{baseTimeType},
- <if test="startTime1 != null and startTime1 != ''">
- #{startTime1},#{bright1},#{color1},
- </if>
- <if test="endTime1 != null and endTime1 != ''">
- #{endTime1},#{endBright1},#{endColor1},
- </if>
- <if test="startTime2 != null and startTime2 != ''">
- #{startTime2},#{bright2},#{color2},
- </if>
- <if test="endTime2 != null and endTime2 != ''">
- #{endTime2},#{endBright2},#{endColor2},
- </if>
- <if test="startTime3 != null and startTime3 != ''">
- #{startTime3},#{bright3},#{color3},
- </if>
- <if test="endTime3 != null and endTime3 != ''">
- #{endTime3},#{endBright3},#{endColor3},
- </if>
- <if test="startTime4 != null and startTime4 != ''">
- #{startTime4},#{bright4},#{color4},
- </if>
- <if test="endTime4 != null and endTime4 != ''">
- #{endTime4},#{endBright4},#{endColor4},
- </if>
- <if test="startTime5 != null and startTime5 != ''">
- #{startTime5},#{bright5},#{color5},
- </if>
- <if test="endTime5 != null and endTime5 != ''">
- #{endTime5},#{endBright5},#{endColor5},
- </if>
- <if test="startTime6 != null and startTime6 != ''">
- #{startTime6},#{bright6},#{color6},
- </if>
- <if test="endTime6 != null and endTime6 != ''">
- #{endTime6},#{endBright6},#{endColor6},
- </if>
- <if test="weekly != null">
- #{weekly},
- </if>
- #{lighterMask})
- </insert>
- <insert id="addPlcPolicyCmdSunType" useGeneratedKeys="true" keyProperty="id" parameterType="PlcPolicyCmdDTO">
- insert into plc_policy_cmd(plc_policy_id, policyType, base_time_type,
- sunrise, start_delay_time, start_bright, start_color,
- sunset, end_delay_time, end_bright, end_color,
- <if test="weekly != null">
- weekly,
- </if>
- lighter_mask)
- values (#{plcPolicyId},#{policyType},#{baseTimeType},
- #{sunrise},#{startDelayTime},#{startBright},#{startColor},
- #{sunset},#{endDelayTime},#{endBright},#{endColor},
- <if test="weekly != null">
- #{weekly},
- </if>
- #{lighterMask})
- </insert>
- <delete id="deletePlcPolicyCmdByPlcPolicyId">
- delete
- from plc_policy_cmd
- where plc_policy_id = #{plcPolicyId};
- </delete>
- </mapper>
|