123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?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.jjt.calc.mapper.TwinCalcDayYhjMapper">
- <resultMap type="TwinCalcDayYhj" id="TwinCalcDayYhjResult">
- <result property="id" column="ID"/>
- <result property="time" column="TIME"/>
- <result property="deviceId" column="DEVICE_ID"/>
- <result property="dayLength" column="DAY_LENGTH"/>
- <result property="dayWeight" column="DAY_WEIGHT"/>
- <result property="length" column="LENGTH"/>
- <result property="weight" column="WEIGHT"/>
- <result property="lengthA" column="LENGTH_A"/>
- <result property="weightA" column="WEIGHT_A"/>
- <result property="lengthB" column="LENGTH_B"/>
- <result property="weightB" column="WEIGHT_B"/>
- <result property="remark" column="REMARK"/>
- </resultMap>
- <sql id="selectTwinCalcDayYhjVo">
- select ID,
- TIME,
- DEVICE_ID,
- DAY_LENGTH,
- DAY_WEIGHT,
- LENGTH,
- WEIGHT,
- LENGTH_A,
- WEIGHT_A,
- LENGTH_B,
- WEIGHT_B,
- REMARK
- from TWIN_CALC_DAY_YHJ
- </sql>
- <select id="selectTwinCalcDayYhjList" parameterType="TwinCalcDayYhj" resultMap="TwinCalcDayYhjResult">
- <include refid="selectTwinCalcDayYhjVo"/>
- <where>
- <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
- and TIME between #{params.beginTime} and #{params.endTime}
- </if>
- <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
- <if test="dayLength != null ">and DAY_LENGTH = #{dayLength}</if>
- <if test="dayWeight != null ">and DAY_WEIGHT = #{dayWeight}</if>
- <if test="params.start != null and params.start != ''">
- and TIME >= #{params.start}
- </if>
- </where>
- order by time desc
- </select>
- <select id="selectTwinCalcDayYhjById" parameterType="Long" resultMap="TwinCalcDayYhjResult">
- <include refid="selectTwinCalcDayYhjVo"/>
- where ID = #{id}
- </select>
- <insert id="insertTwinCalcDayYhj" parameterType="TwinCalcDayYhj">
- insert into TWIN_CALC_DAY_YHJ
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="time != null">TIME,</if>
- <if test="deviceId != null">DEVICE_ID,</if>
- <if test="dayLength != null">DAY_LENGTH,</if>
- <if test="dayWeight != null">DAY_WEIGHT,</if>
- <if test="length != null">LENGTH,</if>
- <if test="weight != null">WEIGHT,</if>
- <if test="lengthA != null">LENGTH_A,</if>
- <if test="weightA != null">WEIGHT_A,</if>
- <if test="lengthB != null">LENGTH_B,</if>
- <if test="weightB != null">WEIGHT_B,</if>
- <if test="remark != null">REMARK,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="time != null">#{time},</if>
- <if test="deviceId != null">#{deviceId},</if>
- <if test="dayLength != null">#{dayLength},</if>
- <if test="dayWeight != null">#{dayWeight},</if>
- <if test="length != null">#{length},</if>
- <if test="weight != null">#{weight},</if>
- <if test="lengthA != null">#{lengthA},</if>
- <if test="weightA != null">#{weightA},</if>
- <if test="lengthB != null">#{lengthB},</if>
- <if test="weightB != null">#{weightB},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateTwinCalcDayYhj" parameterType="TwinCalcDayYhj">
- update TWIN_CALC_DAY_YHJ
- <trim prefix="SET" suffixOverrides=",">
- <if test="time != null">TIME = #{time},</if>
- <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
- <if test="dayLength != null">DAY_LENGTH = #{dayLength},</if>
- <if test="dayWeight != null">DAY_WEIGHT = #{dayWeight},</if>
- <if test="length != null">LENGTH = #{length},</if>
- <if test="weight != null">WEIGHT = #{weight},</if>
- <if test="lengthA != null">LENGTH_A = #{lengthA},</if>
- <if test="weightA != null">WEIGHT_A = #{weightA},</if>
- <if test="lengthB != null">LENGTH_B = #{lengthB},</if>
- <if test="weightB != null">WEIGHT_B = #{weightB},</if>
- <if test="remark != null">REMARK = #{remark},</if>
- </trim>
- where ID = #{id}
- </update>
- <delete id="deleteTwinCalcDayYhjById" parameterType="Long">
- delete
- from TWIN_CALC_DAY_YHJ
- where ID = #{id}
- </delete>
- <delete id="deleteTwinCalcDayYhjByIds" parameterType="String">
- delete from TWIN_CALC_DAY_YHJ where ID in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <delete id="delete4date" parameterType="String">
- DELETE
- from TWIN_CALC_DAY_YHJ
- WHERE TIME = #{date}
- </delete>
- </mapper>
|