<?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.BizResourceSoftwareInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.casic.missiles.model.resource.BizResourceSoftwareInfo">
<id column="id" property="id" />
<result column="report_id" property="reportId" />
<result column="software_document" property="softwareDocument" />
<result column="function_document" property="functionDocument" />
<result column="source_code" property="sourceCode" />
<result column="data_validation_record" property="dataValidationRecord" />
<result column="remark" property="remark" />
<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, report_id, software_document, function_document, source_code, data_validation_record, remark, create_user_id, create_user_name, create_time, update_time
</sql>
<select id="selectSoftwareList" resultMap="BaseResultMap">
SELECT brsi.*, brsrr.software_name, brsrr.software_version
FROM biz_resource_software_info brsi
JOIN biz_resource_software_review_report brsrr ON brsi.report_id = brsrr.id
WHERE 1=1
<if test="request != null and request.softwareName != null and request.softwareName !=''">
and brsrr.software_name like concat(#{request.softwareName},'%')
</if>
<if test="request != null and request.softwareVersion != null and request.softwareVersion !=''">
and brsrr.software_version like concat(#{request.softwareVersion},'%')
</if>
<if test="request != null and request.createUserName != null and request.createUserName !=''">
and brsi.create_user_name like concat('%',#{request.createUserName},'%')
</if>
<if test="request != null and request.updateTimeStart != null and request.updateTimeStart !=''">
and brsi.update_time >= #{request.updateTimeStart}
</if>
<if test="request != null and request.updateTimeEnd != null and request.updateTimeEnd !=''">
and brsi.update_time <= #{request.updateTimeEnd}
</if>
</select>
<select id="selectDetailById" resultMap="BaseResultMap">
SELECT brsi.*, brsrr.software_name, brsrr.software_version, brsrr.report_no
FROM biz_resource_software_info brsi
JOIN biz_resource_software_review_report brsrr ON brsi.report_id = brsrr.id
WHERE brsi.id = #{id}
</select>
</mapper>