<?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.resource.BizResourceSoftwareReviewReportMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.casic.missiles.model.resource.BizResourceSoftwareReviewReport">
<id column="id" property="id" />
<result column="report_no" property="reportNo" />
<result column="report_name" property="reportName" />
<result column="software_name" property="softwareName" />
<result column="software_version" property="softwareVersion" />
<result column="before_software_id" property="beforeSoftwareId" />
<result column="before_software_name" property="beforeSoftwareName" />
<result column="before_software_version" property="beforeSoftwareVersion" />
<result column="review_content" property="reviewContent" />
<result column="lab_code" property="labCode" />
<result column="group_code" property="groupCode" />
<result column="approval_status" property="approvalStatus" />
<result column="process_id" property="processId" />
<result column="create_dept_id" property="createDeptId" />
<result column="create_dept" property="createDept" />
<result column="create_user_id" property="createUserId" />
<result column="create_user_name" property="createUserName" />
<result column="review_type" property="reviewType" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, report_no, report_name, software_name, software_version, before_software_id, before_software_name, review_content, before_software_version,
lab_code, group_code, approval_status, process_id, create_user_id, create_user_name, review_type, create_time, update_time
</sql>
<select id="selectBatchForApprovalList" resultMap="BaseResultMap">
SELECT *
FROM biz_resource_software_review_report
WHERE 1=1
<if test="request != null and request.approvalStatus != null and request.approvalStatus !=''">
and approval_status = #{request.approvalStatus}
</if>
<if test="request != null and request.createUserId != null and request.createUserId !=''">
and create_user_id = #{request.createUserId}
</if>
<if test="request != null and request.reportNo != null and request.reportNo !=''">
and report_no like concat('%',#{request.reportNo},'%')
</if>
<if test="request != null and request.softwareName != null and request.softwareName !=''">
and software_name like concat('%',#{request.softwareName},'%')
</if>
<if test="request != null and request.createUserName != null and request.createUserName !=''">
and create_user_name like concat('%',#{request.createUserName},'%')
</if>
<if test="request != null and request.createDept != null and request.createDept !=''">
and create_dept like concat('%',#{request.createDept},'%')
</if>
<if test="request != null and request.reviewType != null and request.reviewType !=''">
and review_type = #{request.reviewType}
</if>
<if test="request != null and request.softwareVersion != null and request.softwareVersion !=''">
and software_version like concat('%',#{request.softwareVersion},'%')
</if>
<if test="request != null and request.createTimeStart != null and request.createTimeStart !=''">
and create_time >= #{request.createTimeStart}
</if>
<if test="request != null and request.createTimeEnd != null and request.createTimeEnd !=''">
and create_time <= #{request.createTimeEnd}
</if>
<if test="businessKeys != null">
and id in
<foreach collection="businessKeys" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
ORDER BY create_time DESC
</select>
<select id="selectMaxNo" resultType="java.lang.Long">
SELECT IFNULL(max(RIGHT(report_no, 12)), 0) from biz_resource_software_review_report
</select>
</mapper>