| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <?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.LightStripPolicyCmdDao">
-
- <select id="getLightStripPolicyCmdList" resultType="LightStripPolicyCmdDTO">
- select
- l.id,l.value,l.type,l.strip_policy_id as stripPolicyId,
- l.policy_type1 policyType1,l.starttime1 as startTime1,l.type_cmd1 as typeCmd1,
- l.policy_type2 policyType2,l.starttime2 as startTime2,l.type_cmd2 as typeCmd2,
- l.policy_type3 policyType3,l.starttime3 as startTime3,l.type_cmd3 as typeCmd3,
- l.policy_type4 policyType4,l.starttime4 as startTime4,l.type_cmd4 as typeCmd4,
- l.policy_type5 policyType5,l.starttime5 as startTime5,l.type_cmd5 as typeCmd5,
- l.policy_type6 policyType6,l.starttime6 as startTime6,l.type_cmd6 as typeCmd6,
- l.policy_type7 policyType7,l.starttime7 as startTime7,l.type_cmd7 as typeCmd7,
- l.policy_type8 policyType8,l.starttime8 as startTime8,l.type_cmd8 as typeCmd8,
- l.policy_type9 policyType9,l.starttime9 as startTime9,l.type_cmd9 as typeCmd9,
- l.policy_type10 policyType10,l.starttime10 as startTime10,l.type_cmd10 as typeCmd10,
- l.policy_type11 policyType11,l.starttime11 as startTime11,l.type_cmd11 as typeCmd11,
- l.policy_type12 policyType12,l.starttime12 as startTime12,l.type_cmd12 as typeCmd12
- from light_strip_policy_cmd l
- where l.strip_policy_id in
- <foreach collection="ids" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- <insert id="addLightStripPolicyCmdData" parameterType="LightStripPolicyCmdDTO" useGeneratedKeys="true" keyProperty="id">
- insert into light_strip_policy_cmd(strip_policy_id,type,`value`,
- <if test="policyType1 != null and policyType1 != ''">
- policy_type1, starttime1, type_cmd1,
- </if>
- <if test="policyType2 != null and policyType2 != ''">
- policy_type2, starttime2, type_cmd2,
- </if>
- <if test="policyType3 != null and policyType3 != ''">
- policy_type3, starttime3, type_cmd3,
- </if>
- <if test="policyType4 != null and policyType4 != ''">
- policy_type4, starttime4, type_cmd4,
- </if>
- <if test="policyType5 != null and policyType5 != ''">
- policy_type5, starttime5, type_cmd5,
- </if>
- <if test="policyType6 != null and policyType6 != ''">
- policy_type6, starttime6, type_cmd6,
- </if>
- <if test="policyType7 != null and policyType7 != ''">
- policy_type7, starttime7, type_cmd7,
- </if>
- <if test="policyType8 != null and policyType8 != ''">
- policy_type8, starttime8, type_cmd8,
- </if>
- <if test="policyType9 != null and policyType9 != ''">
- policy_type9, starttime9, type_cmd9,
- </if>
- <if test="policyType10 != null and policyType10 != ''">
- policy_type10, starttime10, type_cmd10,
- </if>
- <if test="policyType11 != null and policyType11 != ''">
- policy_type11, starttime11, type_cmd11,
- </if>
- <if test="policyType12 != null and policyType12 != ''">
- policy_type12, starttime12, type_cmd12,
- </if>
- createtime, updatetime)
- values (#{stripPolicyId},#{type},#{value},
- <if test="policyType1 != null and policyType1 != ''">
- #{policyType1},#{startTime1},#{typeCmd1},
- </if>
- <if test="policyType2 != null and policyType2 != ''">
- #{policyType2},#{startTime2},#{typeCmd2},
- </if>
- <if test="policyType3 != null and policyType3 != ''">
- #{policyType3},#{startTime3},#{typeCmd3},
- </if>
- <if test="policyType4 != null and policyType4 != ''">
- #{policyType4},#{startTime4},#{typeCmd4},
- </if>
- <if test="policyType5 != null and policyType5 != ''">
- #{policyType5},#{startTime5},#{typeCmd5},
- </if>
- <if test="policyType6 != null and policyType6 != ''">
- #{policyType6},#{startTime6},#{typeCmd6},
- </if>
- <if test="policyType7 != null and policyType7 != ''">
- #{policyType7},#{startTime7},#{typeCmd7},
- </if>
- <if test="policyType8 != null and policyType8 != ''">
- #{policyType8},#{startTime8},#{typeCmd8},
- </if>
- <if test="policyType9 != null and policyType9 != ''">
- #{policyType9},#{startTime9},#{typeCmd9},
- </if>
- <if test="policyType10 != null and policyType10 != ''">
- #{policyType10},#{startTime10},#{typeCmd10},
- </if>
- <if test="policyType11 != null and policyType11 != ''">
- #{policyType11},#{startTime11},#{typeCmd11},
- </if>
- <if test="policyType12 != null and policyType12 != ''">
- #{policyType12},#{startTime12},#{typeCmd12},
- </if>
- #{createTime},#{updateTime}
- )
- </insert>
- <delete id="deleteLightStripPolicyCmdByPolicyId">
- delete
- from light_strip_policy_cmd
- where strip_policy_id = #{policyId};
- </delete>
- <select id="getStripPolicyCmdByPolicyId" resultType="LightStripPolicyCmdDTO">
- select
- l.id,l.value,l.type,l.strip_policy_id as stripPolicyId,
- l.policy_type1 policyType1,l.starttime1 as startTime1,l.type_cmd1 as typeCmd1,
- l.policy_type2 policyType2,l.starttime2 as startTime2,l.type_cmd2 as typeCmd2,
- l.policy_type3 policyType3,l.starttime3 as startTime3,l.type_cmd3 as typeCmd3,
- l.policy_type4 policyType4,l.starttime4 as startTime4,l.type_cmd4 as typeCmd4,
- l.policy_type5 policyType5,l.starttime5 as startTime5,l.type_cmd5 as typeCmd5,
- l.policy_type6 policyType6,l.starttime6 as startTime6,l.type_cmd6 as typeCmd6,
- l.policy_type7 policyType7,l.starttime7 as startTime7,l.type_cmd7 as typeCmd7,
- l.policy_type8 policyType8,l.starttime8 as startTime8,l.type_cmd8 as typeCmd8,
- l.policy_type9 policyType9,l.starttime9 as startTime9,l.type_cmd9 as typeCmd9,
- l.policy_type10 policyType10,l.starttime10 as startTime10,l.type_cmd10 as typeCmd10,
- l.policy_type11 policyType11,l.starttime11 as startTime11,l.type_cmd11 as typeCmd11,
- l.policy_type12 policyType12,l.starttime12 as startTime12,l.type_cmd12 as typeCmd12
- from light_strip_policy_cmd l
- where l.strip_policy_id = #{policyId}
- </select>
- </mapper>
|