MeasuringDataDefMapper.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.zcxk.smartcity.data.access.dao.MeasuringDataDefMapper">
  5. <sql id="where">
  6. <where>
  7. <if test="params.measuringDesc != null and params.measuringDesc != ''">
  8. and measuring_desc = #{params.measuringDesc}
  9. </if>
  10. <if test="params.dataValue != null and params.dataValue != ''">
  11. and data_value = #{params.dataValue}
  12. </if>
  13. <if test="params.dataName != null and params.dataName != ''">
  14. and data_name = #{params.dataName}
  15. </if>
  16. <if test="params.dataDesc != null and params.dataDesc != ''">
  17. and data_desc = #{params.dataDesc}
  18. </if>
  19. <if test="params.status != null and params.status != ''">
  20. and status = #{params.status}
  21. </if>
  22. </where>
  23. </sql>
  24. <select id="count" resultType="int">
  25. select count(1) from sc_tpl_measuring_data_def t
  26. <include refid="where" />
  27. </select>
  28. <select id="singleQuery" resultType="MeasuringDataDef">
  29. select * from sc_tpl_measuring_data_def t
  30. <include refid="where" />
  31. limit 1
  32. </select>
  33. <select id="list" resultType="MeasuringDataDef">
  34. select * from sc_tpl_measuring_data_def t
  35. <include refid="where" />
  36. ${params.orderBy}
  37. <if test="limit != null and limit != 0">
  38. limit #{offset}, #{limit}
  39. </if>
  40. </select>
  41. <update id="update">
  42. update sc_tpl_measuring_data_def t
  43. <set>
  44. <if test="dataName != null">
  45. data_name = #{dataName},
  46. </if>
  47. <if test="dataDesc != null">
  48. data_desc = #{dataDesc},
  49. </if>
  50. <if test="status != null">
  51. status = #{status},
  52. </if>
  53. <if test="createBy != null">
  54. create_by = #{createBy},
  55. </if>
  56. <if test="updateBy != null">
  57. update_by = #{updateBy},
  58. </if>
  59. <if test="dateCreate != null">
  60. date_create = #{dateCreate},
  61. </if>
  62. <if test="dateUpdate != null">
  63. date_update = #{dateUpdate},
  64. </if>
  65. </set>
  66. where measuring_desc = #{measuringDesc}
  67. and data_value = #{dataValue}
  68. </update>
  69. </mapper>