QwIpadServerLogMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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.QwIpadServerLogMapper">
  6. <resultMap type="QwIpadServerLog" id="QwIpadServerLogResult">
  7. <result property="id" column="id" />
  8. <result property="serverId" column="server_id" />
  9. <result property="qwUserId" column="qw_user_id" />
  10. <result property="companyId" column="company_id" />
  11. <result property="companyUserId" column="company_user_id" />
  12. <result property="tilie" column="tilie" />
  13. <result property="type" column="type" />
  14. <result property="createTime" column="create_time" />
  15. </resultMap>
  16. <sql id="selectQwIpadServerLogVo">
  17. select id, server_id, qw_user_id, company_id, company_user_id, tilie, type, create_time from qw_ipad_server_log
  18. </sql>
  19. <select id="selectQwIpadServerLogList" parameterType="QwIpadServerLog" resultMap="QwIpadServerLogResult">
  20. <include refid="selectQwIpadServerLogVo"/>
  21. <where>
  22. <if test="serverId != null "> and server_id = #{serverId}</if>
  23. <if test="qwUserId != null "> and qw_user_id = #{qwUserId}</if>
  24. <if test="companyId != null "> and company_id = #{companyId}</if>
  25. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  26. <if test="tilie != null and tilie != ''"> and tilie = #{tilie}</if>
  27. <if test="type != null "> and type = #{type}</if>
  28. </where>
  29. </select>
  30. <select id="selectIpadServerLogList" resultType="com.fs.qw.vo.QwIPadServerLogVO">
  31. SELECT sl.id,sl.server_id,sl.qw_user_id,sl.company_id,sl.company_user_id,sl.tilie,sl.type,sl.create_time,s.title server_name,u.qw_user_name,c.company_name,cu.user_name company_user_name FROM qw_ipad_server_log sl
  32. JOIN qw_ipad_server s ON sl.server_id = s.id
  33. JOIN qw_user u ON sl.qw_user_id = u.id
  34. JOIN company c ON sl.company_id = c.company_id
  35. JOIN company_user cu ON sl.company_user_id = cu.user_id
  36. <where>
  37. <if test="serverName != null "> and s.title = #{serverName}</if>
  38. <if test="qwUserName != null "> and u.qw_user_name = #{qwUserName}</if>
  39. <if test="companyName != null "> and c.company_name = #{companyName}</if>
  40. <if test="companyUserName != null "> and cu.user_name = #{companyUserName}</if>
  41. <if test="type != null "> and sl.type = #{type}</if>
  42. </where>
  43. ORDER BY sl.create_time DESC
  44. </select>
  45. <select id="selectQwIpadServerLogById" parameterType="Long" resultMap="QwIpadServerLogResult">
  46. <include refid="selectQwIpadServerLogVo"/>
  47. where id = #{id}
  48. </select>
  49. <insert id="insertQwIpadServerLog" parameterType="QwIpadServerLog">
  50. insert into qw_ipad_server_log
  51. <trim prefix="(" suffix=")" suffixOverrides=",">
  52. <if test="id != null">id,</if>
  53. <if test="serverId != null">server_id,</if>
  54. <if test="qwUserId != null">qw_user_id,</if>
  55. <if test="companyId != null">company_id,</if>
  56. <if test="companyUserId != null">company_user_id,</if>
  57. <if test="tilie != null">tilie,</if>
  58. <if test="type != null">type,</if>
  59. <if test="createTime != null">create_time,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="id != null">#{id},</if>
  63. <if test="serverId != null">#{serverId},</if>
  64. <if test="qwUserId != null">#{qwUserId},</if>
  65. <if test="companyId != null">#{companyId},</if>
  66. <if test="companyUserId != null">#{companyUserId},</if>
  67. <if test="tilie != null">#{tilie},</if>
  68. <if test="type != null">#{type},</if>
  69. <if test="createTime != null">#{createTime},</if>
  70. </trim>
  71. </insert>
  72. <update id="updateQwIpadServerLog" parameterType="QwIpadServerLog">
  73. update qw_ipad_server_log
  74. <trim prefix="SET" suffixOverrides=",">
  75. <if test="serverId != null">server_id = #{serverId},</if>
  76. <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
  77. <if test="companyId != null">company_id = #{companyId},</if>
  78. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  79. <if test="tilie != null">tilie = #{tilie},</if>
  80. <if test="type != null">type = #{type},</if>
  81. <if test="createTime != null">create_time = #{createTime},</if>
  82. </trim>
  83. where id = #{id}
  84. </update>
  85. <delete id="deleteQwIpadServerLogById" parameterType="Long">
  86. delete from qw_ipad_server_log where id = #{id}
  87. </delete>
  88. <delete id="deleteQwIpadServerLogByIds" parameterType="String">
  89. delete from qw_ipad_server_log where id in
  90. <foreach item="id" collection="array" open="(" separator="," close=")">
  91. #{id}
  92. </foreach>
  93. </delete>
  94. </mapper>