<?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.casic.missiles.mapper.quality.BizQualityInternalAuditPlanMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.casic.missiles.model.quality.BizQualityInternalAuditPlan"> <result column="id" property="id"/> <result column="create_time" property="createTime"/> <result column="update_time" property="updateTime"/> <result column="year_time" property="yearTime"/> <result column="biz_lab_code" property="bizLabCode"/> <result column="year_num" property="yearNum"/> <result column="sys_code" property="sysCode"/> <result column="file_code" property="fileCode"/> <result column="file_name" property="fileName"/> <result column="commander_id" property="commanderId"/> <result column="plan_time" property="planTime"/> <result column="audit_objective" property="auditObjective"/> <result column="audit_scope" property="auditScope"/> <result column="audit_basis" property="auditBasis"/> <result column="group_leader" property="groupLeader"/> <result column="group_leader_name" property="groupLeaderName"/> <result column="year_no" property="yearNo"/> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> id , create_time as createTime , update_time as updateTime , year_time as yearTime , biz_lab_code as bizLabCode , year_num as yearNum , sys_code as sysCode , file_code as fileCode , file_name as fileName , commander_id as commanderId , plan_time as planTime , audit_objective as auditObjective , audit_scope as auditScope , audit_basis as auditBasis , group_leader as groupLeader , group_leader_name as groupLeaderName , year_no as yearNo,commander_name as commanderName </sql> <sql id="Base_Column_Alias"> a . id , a.create_time as createTime , a.update_time as updateTime , a.year_time as yearTime , a.biz_lab_code as bizLabCode , a.year_num as yearNum , a.sys_code as sysCode , a.file_code as fileCode , a.file_name as fileName , a.commander_id as commanderId , a.plan_time as planTime , a.audit_objective as auditObjective , a.audit_scope as auditScope , a.audit_basis as auditBasis , a.group_leader as groupLeader , a.group_leader_name as groupLeaderName , a.year_no as yearNo,a.commander_name as commanderName </sql> <select id="selectBizQualityInternalAuditPlanPage" resultType="com.casic.missiles.model.quality.BizQualityInternalAuditPlan"> select <include refid="Base_Column_Alias"/> from biz_quality_internal_audit_plan a <where> <if test="ew != null"> ${ew.sqlSegment} </if> </where> </select> <sql id="Base_Column_Query"> <if test="request!=null"> <if test="request.yearTime!= null and request.yearTime!=''"> and year_time = #{request.yearTime} </if> <if test="request.bizLabCode!= null and request.bizLabCode!=''"> and biz_lab_code = #{request.bizLabCode} </if> <if test="request.yearNum!= null and request.yearNum!=''"> and year_num = #{request.yearNum} </if> <if test="request.fileCode!= null and request.fileCode!=''"> and file_code like concat('%',#{request.fileCode},'%') </if> <if test="request.fileName!= null and request.fileName!=''"> and file_name like concat('%',#{request.fileName},'%') </if> <if test="request.commanderId!= null and request.commanderId!=''"> and commander_id = #{request.commanderId} </if> <if test="request != null and request.createUserId != null and request.createUserId !=''"> and commander_id = #{request.createUserId} </if> </if> </sql> <select id="selectBatchForApprovalList" resultType="com.casic.missiles.model.quality.BizQualityInternalAuditPlan"> select <include refid="Base_Column_Alias"/> from biz_quality_internal_audit_plan a <where> <include refid="Base_Column_Query"/> </where> ORDER BY a.create_time DESC </select> </mapper>