SysLogMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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.xinxin.topro.pubservice.mysqlmapper.SysLogMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.pubservice.mysqlModel.SysLog" >
  5. <id column="LL_ID" property="llId" jdbcType="INTEGER" />
  6. <result column="UI_ID" property="uiId" jdbcType="VARCHAR" />
  7. <result column="LL_AddDate" property="llAdddate" jdbcType="TIMESTAMP" />
  8. <result column="LL_IP" property="llIp" jdbcType="VARCHAR" />
  9. <result column="LL_Status" property="llStatus" jdbcType="INTEGER" />
  10. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  11. </resultMap>
  12. <sql id="Base_Column_List" >
  13. LL_ID, UI_ID, LL_AddDate, LL_IP, LL_Status, HI_ID
  14. </sql>
  15. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  16. select
  17. <include refid="Base_Column_List" />
  18. from sys_loginlog
  19. where LL_ID = #{llId,jdbcType=INTEGER}
  20. </select>
  21. <select id="selectByIP" resultMap="BaseResultMap" parameterType="java.lang.String" >
  22. select
  23. <include refid="Base_Column_List" />
  24. from sys_loginlog
  25. where LL_Status = 1 and LL_IP = #{ip,jdbcType=VARCHAR}
  26. order by LL_AddDate desc
  27. limit 1
  28. </select>
  29. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  30. delete from sys_loginlog
  31. where LL_ID = #{llId,jdbcType=INTEGER}
  32. </delete>
  33. <insert id="insert" parameterType="com.xinxin.topro.pubservice.mysqlModel.SysLog" >
  34. insert into sys_loginlog (LL_ID, UI_ID, LL_AddDate,
  35. LL_IP, LL_Status, HI_ID
  36. )
  37. values (#{llId,jdbcType=INTEGER}, #{uiId,jdbcType=VARCHAR}, #{llAdddate,jdbcType=TIMESTAMP},
  38. #{llIp,jdbcType=VARCHAR}, #{llStatus,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}
  39. )
  40. </insert>
  41. <insert id="insertSelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.SysLog" >
  42. insert into sys_loginlog
  43. <trim prefix="(" suffix=")" suffixOverrides="," >
  44. <if test="llId != null" >
  45. LL_ID,
  46. </if>
  47. <if test="uiId != null" >
  48. UI_ID,
  49. </if>
  50. <if test="llAdddate != null" >
  51. LL_AddDate,
  52. </if>
  53. <if test="llIp != null" >
  54. LL_IP,
  55. </if>
  56. <if test="llStatus != null" >
  57. LL_Status,
  58. </if>
  59. <if test="hiId != null" >
  60. HI_ID,
  61. </if>
  62. </trim>
  63. <trim prefix="values (" suffix=")" suffixOverrides="," >
  64. <if test="llId != null" >
  65. #{llId,jdbcType=INTEGER},
  66. </if>
  67. <if test="uiId != null" >
  68. #{uiId,jdbcType=VARCHAR},
  69. </if>
  70. <if test="llAdddate != null" >
  71. #{llAdddate,jdbcType=TIMESTAMP},
  72. </if>
  73. <if test="llIp != null" >
  74. #{llIp,jdbcType=VARCHAR},
  75. </if>
  76. <if test="llStatus != null" >
  77. #{llStatus,jdbcType=INTEGER},
  78. </if>
  79. <if test="hiId != null" >
  80. #{hiId,jdbcType=INTEGER},
  81. </if>
  82. </trim>
  83. </insert>
  84. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.SysLog" >
  85. update sys_loginlog
  86. <set >
  87. <if test="uiId != null" >
  88. UI_ID = #{uiId,jdbcType=VARCHAR},
  89. </if>
  90. <if test="llAdddate != null" >
  91. LL_AddDate = #{llAdddate,jdbcType=TIMESTAMP},
  92. </if>
  93. <if test="llIp != null" >
  94. LL_IP = #{llIp,jdbcType=VARCHAR},
  95. </if>
  96. <if test="llStatus != null" >
  97. LL_Status = #{llStatus,jdbcType=INTEGER},
  98. </if>
  99. <if test="hiId != null" >
  100. HI_ID = #{hiId,jdbcType=INTEGER},
  101. </if>
  102. </set>
  103. where LL_ID = #{llId,jdbcType=INTEGER}
  104. </update>
  105. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.pubservice.mysqlModel.SysLog" >
  106. update sys_loginlog
  107. set UI_ID = #{uiId,jdbcType=VARCHAR},
  108. LL_AddDate = #{llAdddate,jdbcType=TIMESTAMP},
  109. LL_IP = #{llIp,jdbcType=VARCHAR},
  110. LL_Status = #{llStatus,jdbcType=INTEGER},
  111. HI_ID = #{hiId,jdbcType=INTEGER}
  112. where LL_ID = #{llId,jdbcType=INTEGER}
  113. </update>
  114. <update id="updateStatus" parameterType="java.lang.Integer" >
  115. update sys_loginlog
  116. set LL_Status = -1
  117. where UI_ID = #{uiId,jdbcType=VARCHAR}
  118. </update>
  119. </mapper>