<?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.BizQualityNonReviewFormMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.casic.missiles.model.quality.BizQualityNonReviewForm"> <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="creator" property="creator"/> <result column="creator_name" property="creatorName"/> <result column="year_no" property="yearNo"/> <result column="log_time" property="logTime"/> <result column="approval_status" property="approvalStatus"/> <result column="process_id" property="processId"/> <result column="view_form_id" property="viewFormId"/> <result column="group_no" property="groupNo"/> <result column="dept_id" property="deptId"/> <result column="dept_manager" property="deptManager"/> <result column="dept_manager_name" property="deptManagerName"/> <result column="auditor_id" property="auditorId"/> <result column="auditor_name" property="auditorName"/> <result column="audit_leader_id" property="auditLeaderId"/> <result column="audit_leader_name" property="auditLeaderName"/> <result column="non_description" property="nonDescription"/> <result column="category" property="category"/> <result column="corr_terms" property="corrTerms"/> <result column="cause_analysis" property="causeAnalysis"/> <result column="correction_plan" property="correctionPlan"/> </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 , creator , creator_name as creatorName , year_no as yearNo , log_time as logTime , approval_status as approvalStatus , process_id as processId , view_form_id as viewFormId , group_no as groupNo , dept_id as deptId , dept_manager as deptManager , dept_manager_name as deptManagerName , auditor_id as auditorId , auditor_name as auditorName , audit_leader_id as auditLeaderId , audit_leader_name as auditLeaderName , non_description as nonDescription , category , corr_terms as corrTerms , cause_analysis as causeAnalysis , correction_plan as correctionPlan </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.creator , a.creator_name as creatorName , a.year_no as yearNo , a.log_time as logTime , a.approval_status as approvalStatus , a.process_id as processId , a.view_form_id as viewFormId , a.group_no as groupNo , a.dept_id as deptId , a.dept_manager as deptManager , a.dept_manager_name as deptManagerName , a.auditor_id as auditorId , a.auditor_name as auditorName , a.audit_leader_id as auditLeaderId , a.audit_leader_name as auditLeaderName , a.non_description as nonDescription , a.category , a.corr_terms as corrTerms , a.cause_analysis as causeAnalysis , a.correction_plan as correctionPlan </sql> <select id="selectBizQualityNonReviewFormPage" resultType="com.casic.missiles.model.quality.BizQualityNonReviewForm"> select <include refid="Base_Column_Alias"/> from biz_quality_non_review_form a <where> <if test="ew != null"> ${ew.sqlSegment} </if> </where> ORDER BY a.year_time DESC,a.year_num DESC,a.create_time DESC </select> <sql id="Base_Column_Query"> <if test="request!=null"> <if test="request.createTimeStart!= null and request.createTimeStart !=''"> and a.create_time >= #{request.createTimeStart} </if> <if test="request.createTimeEnd!= null and request.createTimeEnd !=''"> and a.create_time <= #{request.createTimeEnd} </if> <if test="request.bizLabCode!= null and request.bizLabCode!=''"> and a.biz_lab_code = #{request.bizLabCode} </if> <if test="request.fileCode!= null and request.fileCode!=''"> and a.file_code like concat('%',#{request.fileCode},'%') </if> <if test="request.fileName!= null and request.fileName!=''"> and a.file_name like concat('%',#{request.fileName},'%') </if> <if test="request.creator!= null and request.creator!=''"> and a.creator = #{request.creator} </if> <if test="request != null and request.createUserId != null and request.createUserId !=''"> and a.creator = #{request.createUserId} </if> <if test="request.creatorName!= null and request.creatorName!=''"> and a.creator_name like concat('%',#{request.creatorName},'%') </if> <if test="request.deptId!= null and request.deptId!=''"> and a.dept_id = #{request.deptId} </if> <if test="request.deptManagerName!= null and request.deptManagerName!=''"> and a.dept_manager_name like concat('%',#{request.deptManagerName},'%') </if> <if test="request != null and request.approvalStatus != null and request.approvalStatus !=''"> and a.approval_status = #{request.approvalStatus} </if> <if test="request != null and request.yearNo != null and request.yearNo !=''"> and a.year_no = #{yearNo} </if> <if test="businessKeys != null"> and a.id in <foreach collection="businessKeys" item="id" index="index" open="(" close=")" separator=","> #{id} </foreach> </if> <if test="request != null and request.reviewFormFileName != null and request.reviewFormFileName !=''"> and b.file_name like concat('%',#{request.reviewFormFileName},'%') </if> </if> </sql> <select id="selectBatchForApprovalList" resultType="com.casic.missiles.model.quality.BizQualityNonReviewForm"> select <include refid="Base_Column_Alias"/> from biz_quality_non_review_form a left join biz_quality_review_form b on a.view_form_id = b.id WHERE 1=1 <include refid="Base_Column_Query"/> ORDER BY a.year_time DESC,a.year_num DESC,a.create_time DESC </select> </mapper>