DeviceDataParserTplMapper.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.DeviceDataParserTplMapper">
  5. <sql id="where">
  6. <where>
  7. <if test="params.id != null">
  8. and id = #{params.id}
  9. </if>
  10. <if test="params.tplName != null and params.tplName != ''">
  11. and tpl_name = #{params.tplName}
  12. </if>
  13. <if test="params.deviceType != null">
  14. and device_type = #{params.deviceType}
  15. </if>
  16. <if test="params.parserClass != null and params.parserClass != ''">
  17. and parser_class = #{params.parserClass}
  18. </if>
  19. <if test="params.tplContent != null and params.tplContent != ''">
  20. and tpl_content = #{params.tplContent}
  21. </if>
  22. <if test="params.status != null ">
  23. and status = #{params.status}
  24. </if>
  25. <if test="params.version != null and params.version != 0 ">
  26. and version = #{params.version}
  27. </if>
  28. <if test="params.length != null and params.length != 0 ">
  29. and (length = #{params.length} or length is null)
  30. </if>
  31. </where>
  32. </sql>
  33. <select id="count" resultType="int">
  34. select count(1) from sc_device_data_parser_tpl t
  35. <include refid="where" />
  36. </select>
  37. <select id="singleQuery" resultType="DeviceDataParserTpl">
  38. select * from sc_device_data_parser_tpl t
  39. <include refid="where" />
  40. </select>
  41. <select id="list" resultType="DeviceDataParserTpl">
  42. select * from sc_device_data_parser_tpl t
  43. <include refid="where" />
  44. ${params.orderBy}
  45. <if test="limit != 0" >
  46. limit #{offset}, #{limit}
  47. </if>
  48. </select>
  49. <update id="update">
  50. update sc_device_data_parser_tpl t
  51. <set>
  52. <if test="tplName != null">
  53. tpl_name = #{tplName},
  54. </if>
  55. <if test="deviceType != null">
  56. device_type = #{deviceType},
  57. </if>
  58. <if test="parserClass != null">
  59. parser_class = #{parserClass},
  60. </if>
  61. <if test="tplContent != null">
  62. tpl_content = #{tplContent},
  63. </if>
  64. <if test="isParsered != null">
  65. is_parsered = #{isParsered},
  66. </if>
  67. <if test="status != null">
  68. status = #{status},
  69. </if>
  70. <if test="version != null">
  71. version = #{version},
  72. </if>
  73. <if test="dateCreate != null">
  74. date_create = #{dateCreate},
  75. </if>
  76. <if test="dateUpdate != null">
  77. date_update = #{dateUpdate},
  78. </if>
  79. <if test="createBy != null">
  80. create_by = #{createBy},
  81. </if>
  82. <if test="updateBy != null">
  83. update_by = #{updateBy},
  84. </if>
  85. </set>
  86. where t.id = #{id}
  87. </update>
  88. </mapper>