123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <?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.DeviceApproveBackDao">
- <resultMap type="cn.ourwill.module.house.entity.daily.DeviceApproveBack" id="baseMap">
- <result column="id" property="id"/>
- <result column="back_content" property="backContent"/>
- <result column="back_time" property="backTime"/>
- <result column="back_level" property="backLevel"/>
- <result column="back_name" property="backName"/>
- <result column="c_id" property="cId"/>
- <result column="c_time" property="cTime"/>
- <result column="u_id" property="uId"/>
- <result column="u_time" property="uTime"/>
- <result column="version" property="version"/>
- <result column="uuid" property="uuid"/>
- <result column="sync_flag" property="syncFlag"/>
- </resultMap>
- <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
- parameterType="cn.ourwill.module.house.entity.daily.DeviceApprove">
- INSERT INTO daily_device_feedback
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test=" backContent != null">
- back_content,
- </if>
- <if test=" backTime != null and backTime != ''">
- back_time,
- </if>
- <if test="backLevel !=null">
- back_level,
- </if>
- <if test="backName !=null">
- back_name,
- </if>
- <if test="uuid !=null">
- uuid,
- </if>
- <if test="syncFlag !=null">
- sync_flag,
- </if>
- <if test=" cTime != null">
- c_time,
- </if>
- <if test=" cId != null">
- c_id,
- </if>
- <if test=" uTime != null">
- u_time,
- </if>
- <if test=" uId != null">
- u_id,
- </if>
- <if test=" version != null">
- version
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test=" backContent != null">
- #{backContent},
- </if>
- <if test=" backTime != null and backTime != ''">
- #{backTime},
- </if>
- <if test="backLevel !=null">
- #{backLevel},
- </if>
- <if test="backName !=null">
- #{backName},
- </if>
- <if test="uuid !=null">
- #{uuid},
- </if>
- <if test="syncFlag !=null">
- #{syncFlag},
- </if>
- <if test=" cTime != null">
- #{cTime},
- </if>
- <if test=" cId != null">
- #{cId},
- </if>
- <if test=" uTime != null">
- #{uTime},
- </if>
- <if test=" uId != null">
- #{uId},
- </if>
- <if test=" version != null">
- #{version}
- </if>
- </trim>
- </insert>
- <sql id="columns">
- a.id,
- a.grain_id,
- a.house_id,
- a.status,
- a.application_name,
- a.application_time,
- a.uuid,
- a.remark,
- a.sync_flag,
- </sql>
- <sql id="sgcolumns">
- sg.name AS grainName
- </sql>
- <sql id="joinCols">
- </sql>
- <select id="get" resultMap="baseMap">
- SELECT
- *
- FROM daily_device_feedback
- WHERE id = #{id}
- </select>
- <select id="findList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- <include refid="sgcolumns"/>
- FROM daily_device_feedback a
- LEFT JOIN sys_grain sg on sg.id=a.grain_id
- <include refid="joinCols"/>
- <where>
- <if test="grainList !=null">
- and a.grain_id in
- <foreach item="item" index="index" collection="grainList" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="statusList !=null">
- and a.status in
- <foreach item="item" index="index" collection="statusList" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="status !=null">
- and a.status = #{status}
- </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="getByUuid" resultMap="baseMap">
- select * from daily_device_feedback where uuid=#{uuid} and back_level=#{backLevel}
- </select>
- <delete id="deleteById">
- delete from daily_device_feedback where id=#{id}
- </delete>
- <delete id="deleteByUuid">
- delete from daily_device_feedback where uuid=#{uuid}
- </delete>
- </mapper>
|