RegistLogMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.tuoren.forward.mapper.RegistLogMapper">
  4. <resultMap id="BaseResultMap" type="com.tuoren.forward.entity.RegistLog">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="mac" jdbcType="VARCHAR" property="mac" />
  7. <result column="param" jdbcType="VARCHAR" property="param" />
  8. <result column="result" jdbcType="VARCHAR" property="result" />
  9. <result column="status" jdbcType="CHAR" property="status" />
  10. <result column="waste" jdbcType="VARCHAR" property="waste" />
  11. <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
  12. </resultMap>
  13. <sql id="Base_Column_List">
  14. id, mac, param, result, status, waste, createtime
  15. </sql>
  16. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  17. select
  18. <include refid="Base_Column_List" />
  19. from regist_log
  20. where id = #{id,jdbcType=VARCHAR}
  21. </select>
  22. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  23. delete from regist_log
  24. where id = #{id,jdbcType=VARCHAR}
  25. </delete>
  26. <insert id="insert" parameterType="com.tuoren.forward.entity.RegistLog">
  27. insert into regist_log (id, mac, param,
  28. result, status, waste,
  29. createtime)
  30. values (#{id,jdbcType=VARCHAR}, #{mac,jdbcType=VARCHAR}, #{param,jdbcType=VARCHAR},
  31. #{result,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, #{waste,jdbcType=VARCHAR},
  32. #{createtime,jdbcType=TIMESTAMP})
  33. </insert>
  34. <insert id="insertSelective" parameterType="com.tuoren.forward.entity.RegistLog">
  35. insert into regist_log
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="id != null">
  38. id,
  39. </if>
  40. <if test="mac != null">
  41. mac,
  42. </if>
  43. <if test="param != null">
  44. param,
  45. </if>
  46. <if test="result != null">
  47. result,
  48. </if>
  49. <if test="status != null">
  50. status,
  51. </if>
  52. <if test="waste != null">
  53. waste,
  54. </if>
  55. <if test="createtime != null">
  56. createtime,
  57. </if>
  58. </trim>
  59. <trim prefix="values (" suffix=")" suffixOverrides=",">
  60. <if test="id != null">
  61. #{id,jdbcType=VARCHAR},
  62. </if>
  63. <if test="mac != null">
  64. #{mac,jdbcType=VARCHAR},
  65. </if>
  66. <if test="param != null">
  67. #{param,jdbcType=VARCHAR},
  68. </if>
  69. <if test="result != null">
  70. #{result,jdbcType=VARCHAR},
  71. </if>
  72. <if test="status != null">
  73. #{status,jdbcType=CHAR},
  74. </if>
  75. <if test="waste != null">
  76. #{waste,jdbcType=VARCHAR},
  77. </if>
  78. <if test="createtime != null">
  79. #{createtime,jdbcType=TIMESTAMP},
  80. </if>
  81. </trim>
  82. </insert>
  83. <update id="updateByPrimaryKeySelective" parameterType="com.tuoren.forward.entity.RegistLog">
  84. update regist_log
  85. <set>
  86. <if test="mac != null">
  87. mac = #{mac,jdbcType=VARCHAR},
  88. </if>
  89. <if test="param != null">
  90. param = #{param,jdbcType=VARCHAR},
  91. </if>
  92. <if test="result != null">
  93. result = #{result,jdbcType=VARCHAR},
  94. </if>
  95. <if test="status != null">
  96. status = #{status,jdbcType=CHAR},
  97. </if>
  98. <if test="waste != null">
  99. waste = #{waste,jdbcType=VARCHAR},
  100. </if>
  101. <if test="createtime != null">
  102. createtime = #{createtime,jdbcType=TIMESTAMP},
  103. </if>
  104. </set>
  105. where id = #{id,jdbcType=VARCHAR}
  106. </update>
  107. <update id="updateByPrimaryKey" parameterType="com.tuoren.forward.entity.RegistLog">
  108. update regist_log
  109. set mac = #{mac,jdbcType=VARCHAR},
  110. param = #{param,jdbcType=VARCHAR},
  111. result = #{result,jdbcType=VARCHAR},
  112. status = #{status,jdbcType=CHAR},
  113. waste = #{waste,jdbcType=VARCHAR},
  114. createtime = #{createtime,jdbcType=TIMESTAMP}
  115. where id = #{id,jdbcType=VARCHAR}
  116. </update>
  117. <select id="QueryCondition" resultMap="BaseResultMap">
  118. select
  119. <include refid="Base_Column_List" />
  120. from regist_log
  121. <where>
  122. <if test="mac != null">
  123. and mac = #{mac,jdbcType=VARCHAR}
  124. </if>
  125. <if test="status != null">
  126. and status = #{status,jdbcType=VARCHAR}
  127. </if>
  128. <if test="createtime != null">
  129. and createtime = #{createtime,jdbcType=VARCHAR}
  130. </if>
  131. </where>
  132. <if test="sort != null and sort != ''">
  133. ORDER BY ${sort}
  134. <if test="order !=null "> ${order} </if>
  135. </if>
  136. </select>
  137. </mapper>