| | |
| | | <mapper namespace="com.ycl.mapper.AuditHistoryMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ycl.domain.entity.AuditHistory"> |
| | | <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="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> |
| | | |
| | | |
| | | |