123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.fs.qw.mapper.QwIpadServerLogMapper">
- <resultMap type="QwIpadServerLog" id="QwIpadServerLogResult">
- <result property="id" column="id" />
- <result property="serverId" column="server_id" />
- <result property="qwUserId" column="qw_user_id" />
- <result property="companyId" column="company_id" />
- <result property="companyUserId" column="company_user_id" />
- <result property="tilie" column="tilie" />
- <result property="type" column="type" />
- <result property="createTime" column="create_time" />
- </resultMap>
- <sql id="selectQwIpadServerLogVo">
- select id, server_id, qw_user_id, company_id, company_user_id, tilie, type, create_time from qw_ipad_server_log
- </sql>
- <select id="selectQwIpadServerLogList" parameterType="QwIpadServerLog" resultMap="QwIpadServerLogResult">
- <include refid="selectQwIpadServerLogVo"/>
- <where>
- <if test="serverId != null "> and server_id = #{serverId}</if>
- <if test="qwUserId != null "> and qw_user_id = #{qwUserId}</if>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
- <if test="tilie != null and tilie != ''"> and tilie = #{tilie}</if>
- <if test="type != null "> and type = #{type}</if>
- </where>
- </select>
- <select id="selectIpadServerLogList" resultType="com.fs.qw.vo.QwIPadServerLogVO">
- 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
- JOIN qw_ipad_server s ON sl.server_id = s.id
- JOIN qw_user u ON sl.qw_user_id = u.id
- JOIN company c ON sl.company_id = c.company_id
- JOIN company_user cu ON sl.company_user_id = cu.user_id
- <where>
- <if test="serverName != null "> and s.title = #{serverName}</if>
- <if test="qwUserName != null "> and u.qw_user_name = #{qwUserName}</if>
- <if test="companyName != null "> and c.company_name = #{companyName}</if>
- <if test="companyUserName != null "> and cu.user_name = #{companyUserName}</if>
- <if test="type != null "> and sl.type = #{type}</if>
- </where>
- ORDER BY sl.create_time DESC
- </select>
- <select id="selectQwIpadServerLogById" parameterType="Long" resultMap="QwIpadServerLogResult">
- <include refid="selectQwIpadServerLogVo"/>
- where id = #{id}
- </select>
- <insert id="insertQwIpadServerLog" parameterType="QwIpadServerLog">
- insert into qw_ipad_server_log
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="serverId != null">server_id,</if>
- <if test="qwUserId != null">qw_user_id,</if>
- <if test="companyId != null">company_id,</if>
- <if test="companyUserId != null">company_user_id,</if>
- <if test="tilie != null">tilie,</if>
- <if test="type != null">type,</if>
- <if test="createTime != null">create_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="serverId != null">#{serverId},</if>
- <if test="qwUserId != null">#{qwUserId},</if>
- <if test="companyId != null">#{companyId},</if>
- <if test="companyUserId != null">#{companyUserId},</if>
- <if test="tilie != null">#{tilie},</if>
- <if test="type != null">#{type},</if>
- <if test="createTime != null">#{createTime},</if>
- </trim>
- </insert>
- <update id="updateQwIpadServerLog" parameterType="QwIpadServerLog">
- update qw_ipad_server_log
- <trim prefix="SET" suffixOverrides=",">
- <if test="serverId != null">server_id = #{serverId},</if>
- <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
- <if test="companyId != null">company_id = #{companyId},</if>
- <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
- <if test="tilie != null">tilie = #{tilie},</if>
- <if test="type != null">type = #{type},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteQwIpadServerLogById" parameterType="Long">
- delete from qw_ipad_server_log where id = #{id}
- </delete>
- <delete id="deleteQwIpadServerLogByIds" parameterType="String">
- delete from qw_ipad_server_log where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|