QwIpadServerMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.fs.qw.mapper.QwIpadServerMapper">
  6. <resultMap type="QwIpadServer" id="QwIpadServerResult">
  7. <result property="id" column="id" />
  8. <result property="title" column="title" />
  9. <result property="addressId" column="address_id" />
  10. <result property="ip" column="ip" />
  11. <result property="port" column="port" />
  12. <result property="url" column="url" />
  13. <result property="totalCount" column="total_count" />
  14. <result property="count" column="count" />
  15. <result property="createTime" column="create_time" />
  16. <result property="updateTime" column="update_time" />
  17. </resultMap>
  18. <sql id="selectQwIpadServerVo">
  19. select id, title, address_id, ip, port, url, total_count, count, create_time, update_time from qw_ipad_server
  20. </sql>
  21. <select id="selectQwIpadServerList" parameterType="QwIpadServer" resultMap="QwIpadServerResult">
  22. <include refid="selectQwIpadServerVo"/>
  23. <where>
  24. <if test="title != null and title != ''"> and title = #{title}</if>
  25. <if test="addressId != null and addressId != ''"> and address_id = #{addressId}</if>
  26. <if test="ip != null and ip != ''"> and ip = #{ip}</if>
  27. <if test="port != null and port != ''"> and port = #{port}</if>
  28. <if test="url != null and url != ''"> and url = #{url}</if>
  29. <if test="totalCount != null "> and total_count = #{totalCount}</if>
  30. <if test="count != null "> and count = #{count}</if>
  31. </where>
  32. </select>
  33. <select id="selectQwIpadServerById" parameterType="Long" resultMap="QwIpadServerResult">
  34. <include refid="selectQwIpadServerVo"/>
  35. where id = #{id}
  36. </select>
  37. <select id="selectIpAndPort" resultType="com.fs.qw.domain.QwIpadServer">
  38. select id, title, address_id, ip, port, url, total_count, count, create_time, update_time from qw_ipad_server
  39. where ip = #{ipAddress} and port = #{port}
  40. </select>
  41. <insert id="insertQwIpadServer" parameterType="QwIpadServer">
  42. insert into qw_ipad_server
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="id != null">id,</if>
  45. <if test="title != null">title,</if>
  46. <if test="addressId != null">address_id,</if>
  47. <if test="ip != null">ip,</if>
  48. <if test="port != null">port,</if>
  49. <if test="url != null">url,</if>
  50. <if test="totalCount != null">total_count,</if>
  51. <if test="count != null">count,</if>
  52. <if test="createTime != null">create_time,</if>
  53. <if test="updateTime != null">update_time,</if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides=",">
  56. <if test="id != null">#{id},</if>
  57. <if test="title != null">#{title},</if>
  58. <if test="addressId != null">#{addressId},</if>
  59. <if test="ip != null">#{ip},</if>
  60. <if test="port != null">#{port},</if>
  61. <if test="url != null">#{url},</if>
  62. <if test="totalCount != null">#{totalCount},</if>
  63. <if test="count != null">#{count},</if>
  64. <if test="createTime != null">#{createTime},</if>
  65. <if test="updateTime != null">#{updateTime},</if>
  66. </trim>
  67. </insert>
  68. <update id="updateQwIpadServer" parameterType="QwIpadServer">
  69. update qw_ipad_server
  70. <trim prefix="SET" suffixOverrides=",">
  71. <if test="title != null">title = #{title},</if>
  72. <if test="addressId != null">address_id = #{addressId},</if>
  73. <if test="ip != null">ip = #{ip},</if>
  74. <if test="port != null">port = #{port},</if>
  75. <if test="url != null">url = #{url},</if>
  76. <if test="totalCount != null">total_count = #{totalCount},</if>
  77. <if test="count != null">count = #{count},</if>
  78. <if test="createTime != null">create_time = #{createTime},</if>
  79. <if test="updateTime != null">update_time = #{updateTime},</if>
  80. </trim>
  81. where id = #{id}
  82. </update>
  83. <delete id="deleteQwIpadServerById" parameterType="Long">
  84. delete from qw_ipad_server where id = #{id}
  85. </delete>
  86. <delete id="deleteQwIpadServerByIds" parameterType="String">
  87. delete from qw_ipad_server where id in
  88. <foreach item="id" collection="array" open="(" separator="," close=")">
  89. #{id}
  90. </foreach>
  91. </delete>
  92. </mapper>