| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?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.company.mapper.CompanyOperLogMapper">
- <resultMap type="CompanyOperLog" id="CompanyOperLogResult">
- <result property="operId" column="oper_id" />
- <result property="companyId" column="company_id" />
- <result property="title" column="title" />
- <result property="businessType" column="business_type" />
- <result property="method" column="method" />
- <result property="requestMethod" column="request_method" />
- <result property="operatorType" column="operator_type" />
- <result property="operName" column="oper_name" />
- <result property="deptName" column="dept_name" />
- <result property="operUrl" column="oper_url" />
- <result property="operIp" column="oper_ip" />
- <result property="operLocation" column="oper_location" />
- <result property="operParam" column="oper_param" />
- <result property="jsonResult" column="json_result" />
- <result property="status" column="status" />
- <result property="errorMsg" column="error_msg" />
- <result property="operTime" column="oper_time" />
- </resultMap>
- <sql id="selectCompanyOperLogVo">
- select ol.*,c.company_name from company_oper_log ol left join company c on c.company_id = ol.company_id
- </sql>
- <select id="selectCompanyOperLogList" parameterType="CompanyOperLog" resultMap="CompanyOperLogResult">
- <include refid="selectCompanyOperLogVo"/>
- <where>
- <if test="companyId != null "> and ol.company_id = #{companyId}</if>
- <if test="title != null and title != ''"> and title = #{title}</if>
- <if test="businessType != null "> and business_type = #{businessType}</if>
- <if test="method != null and method != ''"> and method = #{method}</if>
- <if test="requestMethod != null and requestMethod != ''"> and request_method = #{requestMethod}</if>
- <if test="operatorType != null "> and operator_type = #{operatorType}</if>
- <if test="operName != null and operName != ''"> and oper_name like concat('%', #{operName}, '%')</if>
- <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
- <if test="operUrl != null and operUrl != ''"> and oper_url = #{operUrl}</if>
- <if test="operIp != null and operIp != ''"> and oper_ip = #{operIp}</if>
- <if test="operLocation != null and operLocation != ''"> and oper_location = #{operLocation}</if>
- <if test="operParam != null and operParam != ''"> and oper_param = #{operParam}</if>
- <if test="jsonResult != null and jsonResult != ''"> and json_result = #{jsonResult}</if>
- <if test="status != null "> and ol.status = #{status}</if>
- <if test="errorMsg != null and errorMsg != ''"> and error_msg = #{errorMsg}</if>
- <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
- and date_format(oper_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
- </if>
- <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
- and date_format(oper_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
- </if>
- </where>
- order by oper_id desc
- </select>
- <select id="selectCompanyOperLogById" parameterType="Long" resultMap="CompanyOperLogResult">
- <include refid="selectCompanyOperLogVo"/>
- where oper_id = #{operId}
- </select>
- <insert id="insertCompanyOperLog" parameterType="CompanyOperLog" useGeneratedKeys="true" keyProperty="operId">
- insert into company_oper_log
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="companyId != null">company_id,</if>
- <if test="title != null">title,</if>
- <if test="businessType != null">business_type,</if>
- <if test="method != null">method,</if>
- <if test="requestMethod != null">request_method,</if>
- <if test="operatorType != null">operator_type,</if>
- <if test="operName != null">oper_name,</if>
- <if test="deptName != null">dept_name,</if>
- <if test="operUrl != null">oper_url,</if>
- <if test="operIp != null">oper_ip,</if>
- <if test="operLocation != null">oper_location,</if>
- <if test="operParam != null">oper_param,</if>
- <if test="jsonResult != null">json_result,</if>
- <if test="status != null">status,</if>
- <if test="errorMsg != null">error_msg,</if>
- <if test="operTime != null">oper_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="companyId != null">#{companyId},</if>
- <if test="title != null">#{title},</if>
- <if test="businessType != null">#{businessType},</if>
- <if test="method != null">#{method},</if>
- <if test="requestMethod != null">#{requestMethod},</if>
- <if test="operatorType != null">#{operatorType},</if>
- <if test="operName != null">#{operName},</if>
- <if test="deptName != null">#{deptName},</if>
- <if test="operUrl != null">#{operUrl},</if>
- <if test="operIp != null">#{operIp},</if>
- <if test="operLocation != null">#{operLocation},</if>
- <if test="operParam != null">#{operParam},</if>
- <if test="jsonResult != null">#{jsonResult},</if>
- <if test="status != null">#{status},</if>
- <if test="errorMsg != null">#{errorMsg},</if>
- <if test="operTime != null">#{operTime},</if>
- </trim>
- </insert>
- <update id="updateCompanyOperLog" parameterType="CompanyOperLog">
- update company_oper_log
- <trim prefix="SET" suffixOverrides=",">
- <if test="companyId != null">company_id = #{companyId},</if>
- <if test="title != null">title = #{title},</if>
- <if test="businessType != null">business_type = #{businessType},</if>
- <if test="method != null">method = #{method},</if>
- <if test="requestMethod != null">request_method = #{requestMethod},</if>
- <if test="operatorType != null">operator_type = #{operatorType},</if>
- <if test="operName != null">oper_name = #{operName},</if>
- <if test="deptName != null">dept_name = #{deptName},</if>
- <if test="operUrl != null">oper_url = #{operUrl},</if>
- <if test="operIp != null">oper_ip = #{operIp},</if>
- <if test="operLocation != null">oper_location = #{operLocation},</if>
- <if test="operParam != null">oper_param = #{operParam},</if>
- <if test="jsonResult != null">json_result = #{jsonResult},</if>
- <if test="status != null">status = #{status},</if>
- <if test="errorMsg != null">error_msg = #{errorMsg},</if>
- <if test="operTime != null">oper_time = #{operTime},</if>
- </trim>
- where oper_id = #{operId}
- </update>
- <delete id="deleteCompanyOperLogById" parameterType="Long">
- delete from company_oper_log where oper_id = #{operId}
- </delete>
- <delete id="deleteCompanyOperLogByIds" parameterType="String">
- delete from company_oper_log where oper_id in
- <foreach item="operId" collection="array" open="(" separator="," close=")">
- #{operId}
- </foreach>
- </delete>
- </mapper>
|