QyzxOperLogMapper.xml 12.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
<?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="cn.timer.api.dao.qyzx.QyzxOperLogMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.qyzx.QyzxOperLog" >
                <result column="oper_id" property="operId" />
                <result column="org_code" property="orgCode" />
                <result column="emp_num" property="empNum" />
                <result column="title" property="title" />
                <result column="business_type" property="businessType" />
                <result column="method" property="method" />
                <result column="request_method" property="requestMethod" />
                <result column="operator_type" property="operatorType" />
                <result column="oper_name" property="operName" />
                <result column="dept_name" property="deptName" />
                <result column="oper_url" property="operUrl" />
                <result column="oper_ip" property="operIp" />
                <result column="oper_location" property="operLocation" />
                <result column="oper_param" property="operParam" />
                <result column="json_result" property="jsonResult" />
                <result column="status" property="status" />
                <result column="error_msg" property="errorMsg" />
                <result column="oper_time" property="operTime" />
    </resultMap>

    <sql id="Base_Column_List">
                oper_id,
                org_code,
                emp_num,
                title,
                business_type,
                method,
                request_method,
                operator_type,
                oper_name,
                dept_name,
                oper_url,
                oper_ip,
                oper_location,
                <!-- oper_param, -->
                <!-- json_result, -->
                status,
                error_msg,
                oper_time
    </sql>
    
    <sql id="Base_Column_List_Alias">
                oper_id QyzxOperLog_oper_id,
                org_code QyzxOperLog_org_code,
                emp_num QyzxOperLog_emp_num,
                title QyzxOperLog_title,
                business_type QyzxOperLog_business_type,
                method QyzxOperLog_method,
                request_method QyzxOperLog_request_method,
                operator_type QyzxOperLog_operator_type,
                oper_name QyzxOperLog_oper_name,
                dept_name QyzxOperLog_dept_name,
                oper_url QyzxOperLog_oper_url,
                oper_ip QyzxOperLog_oper_ip,
                oper_location QyzxOperLog_oper_location,
                oper_param QyzxOperLog_oper_param,
                json_result QyzxOperLog_json_result,
                status QyzxOperLog_status,
                error_msg QyzxOperLog_error_msg,
                oper_time QyzxOperLog_oper_time
    </sql>


	<select id="selectPageByQuery" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM qyzx_oper_log a
        WHERE a.org_code = #{param.orgCode} 
        	<if test="param.query != null and param.query != ''">
        		and (
        			a.title like CONCAT('%',#{param.query},'%') or
        			a.oper_name like CONCAT('%',#{param.query},'%') or
        			a.oper_id like CONCAT('%',#{param.query},'%') 
        		)
        	</if>
        	<if test="param.businessType != null">
        		and a.business_type = #{param.businessType}
			</if>
        	<if test="param.operatorType != null">
        		and a.operator_type = #{param.operatorType}
			</if>
        	<if test="param.requestMethod != null">
        		and a.request_method = #{param.requestMethod}
			</if>
        	<if test="param.startTime != null and param.startTime != ''">
        		and a.oper_time <![CDATA[ >= ]]> #{param.startTime}
        	</if>
        	<if test="param.endTime != null and param.endTime != ''">
        		and a.oper_time <![CDATA[ <= ]]> #{param.endTime}
        	</if>
        ORDER BY a.oper_time DESC
    </select>

	<select id="selectPageByQuery2" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM qyzx_oper_log a
        WHERE a.org_code = #{param.orgCode} 
        
        <if test="param.empNums != null and param.empNums.size() > 0">
        		<choose>
					<when test="param.empNums.size() > 1">
						AND a.emp_num IN 
						(
						<foreach item="it" index="index" collection="param.empNums" separator="," close="" >
				        	#{it}
						</foreach>
						) 
					</when>
					<otherwise>
						AND a.emp_num = #{param.empNums[0]}
					</otherwise>
				</choose>
        	</if>
        
        	<if test="param.query != null and param.query != ''">
        		and (
        			a.title like CONCAT('%',#{param.query},'%') or
        			a.oper_name like CONCAT('%',#{param.query},'%') or
        			a.oper_id like CONCAT('%',#{param.query},'%') 
        		)
        	</if>
        	<if test="param.businessType != null">
        		and a.business_type = #{param.businessType}
			</if>
        	<if test="param.operatorType != null">
        		and a.operator_type = #{param.operatorType}
			</if>
        	<if test="param.requestMethod != null">
        		and a.request_method = #{param.requestMethod}
			</if>
        	<if test="param.startTime != null and param.startTime != ''">
        		and a.oper_time <![CDATA[ >= ]]> #{param.startTime}
        	</if>
        	<if test="param.endTime != null and param.endTime != ''">
        		and a.oper_time <![CDATA[ <= ]]> #{param.endTime}
        	</if>
        ORDER BY a.oper_time DESC
    </select>

	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.qyzx.QyzxOperLog">
        INSERT INTO qyzx_oper_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != operId'>
                        oper_id,
                        </if>
                        <if test ='null != orgCode'>
                        org_code,
                        </if>
                        <if test ='null != empNum'>
                        emp_num,
                        </if>
                        <if test ='null != title'>
                        title,
                        </if>
                        <if test ='null != businessType'>
                        business_type,
                        </if>
                        <if test ='null != method'>
                        method,
                        </if>
                        <if test ='null != requestMethod'>
                        request_method,
                        </if>
                        <if test ='null != operatorType'>
                        operator_type,
                        </if>
                        <if test ='null != operName'>
                        oper_name,
                        </if>
                        <if test ='null != deptName'>
                        dept_name,
                        </if>
                        <if test ='null != operUrl'>
                        oper_url,
                        </if>
                        <if test ='null != operIp'>
                        oper_ip,
                        </if>
                        <if test ='null != operLocation'>
                        oper_location,
                        </if>
                        <if test ='null != operParam'>
                        oper_param,
                        </if>
                        <if test ='null != jsonResult'>
                        json_result,
                        </if>
                        <if test ='null != status'>
                        status,
                        </if>
                        <if test ='null != errorMsg'>
                        error_msg,
                        </if>
                        <if test ='null != operTime'>
                        oper_time
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != operId'>
                        #{operId},
                        </if>
                        <if test ='null != orgCode'>
                        #{orgCode},
                        </if>
                        <if test ='null != empNum'>
                        #{empNum},
                        </if>
                        <if test ='null != title'>
                        #{title},
                        </if>
                        <if test ='null != businessType'>
                        #{businessType},
                        </if>
                        <if test ='null != method'>
                        #{method},
                        </if>
                        <if test ='null != requestMethod'>
                        #{requestMethod},
                        </if>
                        <if test ='null != operatorType'>
                        #{operatorType},
                        </if>
                        <if test ='null != operName'>
                        #{operName},
                        </if>
                        <if test ='null != deptName'>
                        #{deptName},
                        </if>
                        <if test ='null != operUrl'>
                        #{operUrl},
                        </if>
                        <if test ='null != operIp'>
                        #{operIp},
                        </if>
                        <if test ='null != operLocation'>
                        #{operLocation},
                        </if>
                        <if test ='null != operParam'>
                        #{operParam},
                        </if>
                        <if test ='null != jsonResult'>
                        #{jsonResult},
                        </if>
                        <if test ='null != status'>
                        #{status},
                        </if>
                        <if test ='null != errorMsg'>
                        #{errorMsg},
                        </if>
                        <if test ='null != operTime'>
                        #{operTime}
                        </if>
        </trim>
    </insert>

    <delete id="delete" >
        DELETE FROM qyzx_oper_log
        WHERE id = #{id}
    </delete>

    <update id="update" parameterType="cn.timer.api.bean.qyzx.QyzxOperLog">
        UPDATE qyzx_oper_log
        <set>
                    <if test ='null != operId'>oper_id = #{operId},</if>
                    <if test ='null != orgCode'>org_code = #{orgCode},</if>
                    <if test ='null != empNum'>emp_num = #{empNum},</if>
                    <if test ='null != title'>title = #{title},</if>
                    <if test ='null != businessType'>business_type = #{businessType},</if>
                    <if test ='null != method'>method = #{method},</if>
                    <if test ='null != requestMethod'>request_method = #{requestMethod},</if>
                    <if test ='null != operatorType'>operator_type = #{operatorType},</if>
                    <if test ='null != operName'>oper_name = #{operName},</if>
                    <if test ='null != deptName'>dept_name = #{deptName},</if>
                    <if test ='null != operUrl'>oper_url = #{operUrl},</if>
                    <if test ='null != operIp'>oper_ip = #{operIp},</if>
                    <if test ='null != operLocation'>oper_location = #{operLocation},</if>
                    <if test ='null != operParam'>oper_param = #{operParam},</if>
                    <if test ='null != jsonResult'>json_result = #{jsonResult},</if>
                    <if test ='null != status'>status = #{status},</if>
                    <if test ='null != errorMsg'>error_msg = #{errorMsg},</if>
                    <if test ='null != operTime'>oper_time = #{operTime}</if>
        </set>
        WHERE id = #{id}
    </update>


    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM qyzx_oper_log
        WHERE id = #{id}
    </select>

    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM qyzx_oper_log
        LIMIT #{offset}, #{pageSize}
    </select>

    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM qyzx_oper_log
    </select>

	 -->

</mapper>