TwinCalcDayYhjMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.jjt.calc.mapper.TwinCalcDayYhjMapper">
  6. <resultMap type="TwinCalcDayYhj" id="TwinCalcDayYhjResult">
  7. <result property="id" column="ID"/>
  8. <result property="time" column="TIME"/>
  9. <result property="deviceId" column="DEVICE_ID"/>
  10. <result property="dayLength" column="DAY_LENGTH"/>
  11. <result property="dayWeight" column="DAY_WEIGHT"/>
  12. <result property="length" column="LENGTH"/>
  13. <result property="weight" column="WEIGHT"/>
  14. <result property="lengthA" column="LENGTH_A"/>
  15. <result property="weightA" column="WEIGHT_A"/>
  16. <result property="lengthB" column="LENGTH_B"/>
  17. <result property="weightB" column="WEIGHT_B"/>
  18. <result property="remark" column="REMARK"/>
  19. </resultMap>
  20. <sql id="selectTwinCalcDayYhjVo">
  21. select ID,
  22. TIME,
  23. DEVICE_ID,
  24. DAY_LENGTH,
  25. DAY_WEIGHT,
  26. LENGTH,
  27. WEIGHT,
  28. LENGTH_A,
  29. WEIGHT_A,
  30. LENGTH_B,
  31. WEIGHT_B,
  32. REMARK
  33. from TWIN_CALC_DAY_YHJ
  34. </sql>
  35. <select id="selectTwinCalcDayYhjList" parameterType="TwinCalcDayYhj" resultMap="TwinCalcDayYhjResult">
  36. <include refid="selectTwinCalcDayYhjVo"/>
  37. <where>
  38. <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
  39. and TIME between #{params.beginTime} and #{params.endTime}
  40. </if>
  41. <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
  42. <if test="dayLength != null ">and DAY_LENGTH = #{dayLength}</if>
  43. <if test="dayWeight != null ">and DAY_WEIGHT = #{dayWeight}</if>
  44. <if test="params.start != null and params.start != ''">
  45. and TIME >= #{params.start}
  46. </if>
  47. </where>
  48. order by time desc
  49. </select>
  50. <select id="selectTwinCalcDayYhjById" parameterType="Long" resultMap="TwinCalcDayYhjResult">
  51. <include refid="selectTwinCalcDayYhjVo"/>
  52. where ID = #{id}
  53. </select>
  54. <insert id="insertTwinCalcDayYhj" parameterType="TwinCalcDayYhj">
  55. insert into TWIN_CALC_DAY_YHJ
  56. <trim prefix="(" suffix=")" suffixOverrides=",">
  57. <if test="time != null">TIME,</if>
  58. <if test="deviceId != null">DEVICE_ID,</if>
  59. <if test="dayLength != null">DAY_LENGTH,</if>
  60. <if test="dayWeight != null">DAY_WEIGHT,</if>
  61. <if test="length != null">LENGTH,</if>
  62. <if test="weight != null">WEIGHT,</if>
  63. <if test="lengthA != null">LENGTH_A,</if>
  64. <if test="weightA != null">WEIGHT_A,</if>
  65. <if test="lengthB != null">LENGTH_B,</if>
  66. <if test="weightB != null">WEIGHT_B,</if>
  67. <if test="remark != null">REMARK,</if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides=",">
  70. <if test="time != null">#{time},</if>
  71. <if test="deviceId != null">#{deviceId},</if>
  72. <if test="dayLength != null">#{dayLength},</if>
  73. <if test="dayWeight != null">#{dayWeight},</if>
  74. <if test="length != null">#{length},</if>
  75. <if test="weight != null">#{weight},</if>
  76. <if test="lengthA != null">#{lengthA},</if>
  77. <if test="weightA != null">#{weightA},</if>
  78. <if test="lengthB != null">#{lengthB},</if>
  79. <if test="weightB != null">#{weightB},</if>
  80. <if test="remark != null">#{remark},</if>
  81. </trim>
  82. </insert>
  83. <update id="updateTwinCalcDayYhj" parameterType="TwinCalcDayYhj">
  84. update TWIN_CALC_DAY_YHJ
  85. <trim prefix="SET" suffixOverrides=",">
  86. <if test="time != null">TIME = #{time},</if>
  87. <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
  88. <if test="dayLength != null">DAY_LENGTH = #{dayLength},</if>
  89. <if test="dayWeight != null">DAY_WEIGHT = #{dayWeight},</if>
  90. <if test="length != null">LENGTH = #{length},</if>
  91. <if test="weight != null">WEIGHT = #{weight},</if>
  92. <if test="lengthA != null">LENGTH_A = #{lengthA},</if>
  93. <if test="weightA != null">WEIGHT_A = #{weightA},</if>
  94. <if test="lengthB != null">LENGTH_B = #{lengthB},</if>
  95. <if test="weightB != null">WEIGHT_B = #{weightB},</if>
  96. <if test="remark != null">REMARK = #{remark},</if>
  97. </trim>
  98. where ID = #{id}
  99. </update>
  100. <delete id="deleteTwinCalcDayYhjById" parameterType="Long">
  101. delete
  102. from TWIN_CALC_DAY_YHJ
  103. where ID = #{id}
  104. </delete>
  105. <delete id="deleteTwinCalcDayYhjByIds" parameterType="String">
  106. delete from TWIN_CALC_DAY_YHJ where ID in
  107. <foreach item="id" collection="array" open="(" separator="," close=")">
  108. #{id}
  109. </foreach>
  110. </delete>
  111. <delete id="delete4date" parameterType="String">
  112. DELETE
  113. from TWIN_CALC_DAY_YHJ
  114. WHERE TIME = #{date}
  115. </delete>
  116. </mapper>