You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

439 lines
19 KiB
XML

<?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.foreverwin.mesnac.common.mapper.OperLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.OperLog">
<id column="HANDLE" property="handle"/>
<result column="SITE" property="site"/>
<result column="TITLE" property="title"/>
<result column="METHOD" property="method"/>
<result column="OPER_PARAM" property="operParam"/>
<result column="RESULT" property="result"/>
<result column="ERROR_MSG" property="errorMsg"/>
<result column="OPER_USER" property="operUser"/>
<result column="OPER_TIME" property="operTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, TITLE, METHOD, OPER_PARAM, RESULT, ERROR_MSG, OPER_USER, OPER_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_OPER_LOG WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"></include>
FROM Z_OPER_LOG
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"></include>
FROM Z_OPER_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_OPER_LOG
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null">AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null">AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null">AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null">AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null">AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null">AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null">AND OPER_TIME=#{ew.entity.operTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null">AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null">AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null">AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null">AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null">AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null">AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null">AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null">AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null">AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null">AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null">AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null">AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null">AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null">AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null">AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null">AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null">AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null">AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null">AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null">AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null">AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null">AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null">AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null">AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null">AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null">AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null">AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null">AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null">AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null">AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null">AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null">AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null">AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null">AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null">AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null">AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null">AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null">AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null">AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null">AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null">AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null">AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.common.model.OperLog">
INSERT INTO Z_OPER_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="title!=null">TITLE,</if>
<if test="method!=null">METHOD,</if>
<if test="operParam!=null">OPER_PARAM,</if>
<if test="result!=null">RESULT,</if>
<if test="errorMsg!=null">ERROR_MSG,</if>
<if test="operUser!=null">OPER_USER,</if>
<if test="operTime!=null">OPER_TIME,</if>
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="title!=null">#{title},</if>
<if test="method!=null">#{method},</if>
<if test="operParam!=null">#{operParam},</if>
<if test="result!=null">#{result},</if>
<if test="errorMsg!=null">#{errorMsg},</if>
<if test="operUser!=null">#{operUser},</if>
<if test="operTime!=null">#{operTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.OperLog">
INSERT INTO Z_OPER_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{title},
#{method},
#{operParam},
#{result},
#{errorMsg},
#{operUser},
#{operTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_OPER_LOG
<trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.title!=null">TITLE=#{et.title},</if>
<if test="et.method!=null">METHOD=#{et.method},</if>
<if test="et.operParam!=null">OPER_PARAM=#{et.operParam},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.errorMsg!=null">ERROR_MSG=#{et.errorMsg},</if>
<if test="et.operUser!=null">OPER_USER=#{et.operUser},</if>
<if test="et.operTime!=null">OPER_TIME=#{et.operTime},</if>
</trim>
WHERE HANDLE=#{et.handle}
<if test="et instanceof java.util.Map">
<if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and
${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
</if>
</if>
</update>
<update id="updateAllColumnById">
UPDATE Z_OPER_LOG <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
TITLE=#{et.title},
METHOD=#{et.method},
OPER_PARAM=#{et.operParam},
RESULT=#{et.result},
ERROR_MSG=#{et.errorMsg},
OPER_USER=#{et.operUser},
OPER_TIME=#{et.operTime},
</trim> WHERE HANDLE=#{et.handle}
<if test="et instanceof java.util.Map">
<if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and
${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
</if>
</if>
</update>
<update id="update">
UPDATE Z_OPER_LOG
<trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.title!=null">TITLE=#{et.title},</if>
<if test="et.method!=null">METHOD=#{et.method},</if>
<if test="et.operParam!=null">OPER_PARAM=#{et.operParam},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.errorMsg!=null">ERROR_MSG=#{et.errorMsg},</if>
<if test="et.operUser!=null">OPER_USER=#{et.operUser},</if>
<if test="et.operTime!=null">OPER_TIME=#{et.operTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null">AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null">AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null">AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null">AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null">AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null">AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null">AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_OPER_LOG WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_OPER_LOG
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null">AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null">AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null">AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null">AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null">AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null">AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null">AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_OPER_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>