AuthorizeLogMapper.xml 1.6 KB

1234567891011121314151617181920212223242526
  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.usoftchina.saas.auth.mapper.AuthorizeLogMapper">
  4. <insert id="insert">
  5. insert into au_authorize_log(app_id,account_id,client_ip,user_agent,login_time)
  6. values (#{appId,jdbcType=VARCHAR}, #{accountId,jdbcType=BIGINT}, #{clientIp,jdbcType=VARCHAR},
  7. #{userAgent,jdbcType=VARCHAR}, #{loginTime,jdbcType=TIMESTAMP})
  8. </insert>
  9. <resultMap id="BaseResultMap" type="com.usoftchina.saas.auth.po.AuthorizeLog">
  10. <id column="id" property="id" jdbcType="BIGINT" />
  11. <result column="account_id" property="accountId" jdbcType="BIGINT" />
  12. <result column="client_ip" property="clientIp" jdbcType="VARCHAR" />
  13. <result column="user_agent" property="userAgent" jdbcType="VARCHAR" />
  14. <result column="login_time" property="loginTime" jdbcType="TIMESTAMP" />
  15. <result column="app_id" property="appId" jdbcType="VARCHAR" />
  16. </resultMap>
  17. <select id="selectByAppIdAndAccountId" resultMap="BaseResultMap">
  18. select * from au_authorize_log where app_id=#{appId} and account_id=#{accountId}
  19. order by login_time desc
  20. </select>
  21. <insert id="insertVirtual" parameterType="com.usoftchina.saas.auth.po.VirtualAuthorizeLog">
  22. insert into au_virtual_authorize_log(app_id,mobile,client_ip,user_agent,login_time)
  23. values (#{appId,jdbcType=VARCHAR}, #{mobile,jdbcType=BIGINT}, #{clientIp,jdbcType=VARCHAR},
  24. #{userAgent,jdbcType=VARCHAR}, #{loginTime,jdbcType=TIMESTAMP})
  25. </insert>
  26. </mapper>