123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <?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="cn.ourwill.module.house.dao.daily.DailyRecordAirconditionerDao">
-
- <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordAirconditioner" id="baseMap">
- <result column= "id" property="id" />
- <result column= "device_id" property="deviceId" />
- <result column= "grain_id" property="grainId" />
- <result column= "run_time" property="runTime" />
- <result column= "time_consum" property="timeConsum" />
- <result column= "open_purpose" property="openPurpose" />
- <result column= "run_status" property="runStatus" />
- <result column= "handle_status" property="handleStatus" />
- <result column= "operator" property="operator" />
- <result column= "remark" property="remark" />
- <result column= "use_energy" property="useEnergy" />
- </resultMap>
-
- <sql id="dailyRecordAirconditionerColumns">
- id ,
- device_id ,
- grain_id ,
- run_time ,
- time_consum ,
- open_purpose ,
- run_status ,
- handle_status ,
- operator ,
- remark ,
- use_energy ,
- problem
- </sql>
-
- <sql id="dailyRecordAirconditionerJoins">
- </sql>
-
- <select id="get" resultType="cn.ourwill.module.house.entity.daily.DailyRecordAirconditioner">
- SELECT
- <include refid="dailyRecordAirconditionerColumns"/>
- FROM daily_record_airconditioner a
- <include refid="dailyRecordAirconditionerJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultType="cn.ourwill.module.house.entity.daily.DailyRecordAirconditioner">
- SELECT
- <include refid="dailyRecordAirconditionerColumns"/>
- FROM daily_record_airconditioner a
- <include refid="dailyRecordAirconditionerJoins"/>
- <where>
- <if test="deviceId !=null and deviceId != ''">
- and a.device_id=${deviceId}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <select id="findAllList" resultType="cn.ourwill.module.house.entity.daily.DailyRecordAirconditioner">
- SELECT
- <include refid="dailyRecordAirconditionerColumns"/>
- FROM daily_record_airconditioner a
- <include refid="dailyRecordAirconditionerJoins"/>
- <where>
-
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <insert id="insert">
- INSERT INTO daily_record_airconditioner
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test=" id != null" >
- id,
- </if>
- <if test=" deviceId != null" >
- device_id,
- </if>
- <if test=" grainId != null" >
- grain_id,
- </if>
- <if test=" runTime != null" >
- run_time,
- </if>
- <if test=" timeConsum != null" >
- time_consum,
- </if>
- <if test=" openPurpose != null" >
- open_purpose,
- </if>
- <if test=" runStatus != null" >
- run_status,
- </if>
- <if test=" handleStatus != null" >
- handle_status,
- </if>
- <if test=" operator != null" >
- operator,
- </if>
- <if test=" remark != null" >
- remark,
- </if>
- <if test=" useEnergy != null" >
- use_energy,
- </if>
- <if test=" problem != null" >
- problem</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test=" id != null" >
- #{id},
- </if>
- <if test=" deviceId != null" >
- #{deviceId},
- </if>
- <if test=" grainId != null" >
- #{grainId},
- </if>
- <if test=" runTime != null" >
- #{runTime},
- </if>
- <if test=" timeConsum != null" >
- #{timeConsum},
- </if>
- <if test=" openPurpose != null" >
- #{openPurpose},
- </if>
- <if test=" runStatus != null" >
- #{runStatus},
- </if>
- <if test=" handleStatus != null" >
- #{handleStatus},
- </if>
- <if test=" operator != null" >
- #{operator},
- </if>
- <if test=" remark != null" >
- #{remark},
- </if>
- <if test=" useEnergy != null" >
- #{useEnergy},
- </if>
- <if test=" problem != null" >
- #{problem}</if>
- </trim>
- </insert>
-
- <update id="update">
- UPDATE daily_record_airconditioner SET
- device_id = #{deviceId},
- grain_id = #{grainId},
- run_time = #{runTime},
- time_consum = #{timeConsum},
- open_purpose = #{openPurpose},
- run_status = #{runStatus},
- handle_status = #{handleStatus},
- operator = #{operator},
- remark = #{remark},
- use_energy = #{useEnergy},
- problem = #{problem}
- WHERE id = #{id}
- </update>
-
- <update id="delete">
- DELETE FROM daily_record_airconditioner
- WHERE id = #{id}
- </update>
- <update id="deleteByIds">
- DELETE FROM daily_record_airconditioner
- WHERE id in (#{ids})
- </update>
-
- </mapper>
|