<?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.BizResourceSoftwareRevisionApplyMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.casic.missiles.model.resource.BizResourceSoftwareRevisionApply"> <id column="id" property="id" /> <result column="apply_no" property="applyNo" /> <result column="apply_name" property="applyName" /> <result column="software_id" property="softwareId" /> <result column="software_name" property="softwareName" /> <result column="software_version" property="softwareVersion" /> <result column="revision_reason" property="revisionReason" /> <result column="remark" property="remark" /> <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="create_time" property="createTime" /> <result column="update_time" property="updateTime" /> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> id, apply_no, apply_name, software_id, software_name, software_version, revision_reason, remark, lab_code, group_code, approval_status, process_id, create_dept_id, create_dept, create_user_id, create_user_name, create_time, update_time </sql> <select id="selectBatchForApprovalList" resultMap="BaseResultMap"> SELECT * FROM biz_resource_software_revision_apply 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.labCode != null and request.labCode !=''"> and lab_code = #{request.labCode} </if> <if test="request != null and request.groupCode != null and request.groupCode !=''"> and group_code = #{request.groupCode} </if> <if test="request != null and request.applyNo != null and request.applyNo !=''"> and apply_no like concat('%',#{request.applyNo},'%') </if> <if test="request != null and request.revisionReason != null and request.revisionReason !=''"> and revision_reason like concat('%',#{request.revisionReason},'%') </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.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(apply_no, 12)), 0) from biz_resource_software_revision_apply </select> </mapper>