<?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.ycl.mapper.AuditHistoryMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ycl.domain.vo.AuditHistoryVO">
|
<result column="task_id" property="taskId" />
|
<result column="task_definition_key" property="taskDefinitionKey" />
|
<result column="viewer" property="viewer" />
|
<result column="commit_dept" property="commitDept" />
|
<result column="audit_type" property="auditType" />
|
<result column="is_read" property="isRead" />
|
<result column="business_key" property="businessKey" />
|
<result column="business_table" property="businessTable" />
|
<result column="content" property="content" />
|
<result column="project_name" property="projectName" />
|
</resultMap>
|
<select id="getPage" resultMap="BaseResultMap">
|
SELECT
|
ah.task_id,
|
ah.task_definition_key,
|
ah.viewer,
|
ah.commit_dept,
|
ah.audit_type,
|
ah.is_read,
|
ah.business_key,
|
ah.business_table,
|
ah.content,
|
pi.project_name
|
FROM t_audit_history ah
|
LEFT JOIN t_project_info pi ON ah.business_key = pi.id
|
WHERE ah.deleted = 0
|
AND pi.deleted = 0
|
<if test="query.projectIds != null and query.projectIds.size() > 0">
|
AND ah.business_key IN
|
<foreach collection="query.projectIds" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
<if test="query.deptId != null">
|
AND
|
ah.commit_dept = #{query.deptId}
|
</if>
|
ORDER BY ah.gmt_create DESC
|
</select>
|
|
|
|
</mapper>
|