lxw
2022-09-14 557742de769b59c94ae91aa79b23e91f642b0dda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?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.whyc.mapper.SoftwareMapper">
    <resultMap id="softwares" type="softDto">
        <result column="file_url" property="fileUrl"></result>
        <collection property="softwares" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Software" column="{fileUrl=file_url}" select="selectSoftWare">
        </collection>
    </resultMap>
 
    <select id="getFileUrl" resultMap="softwares">
        select  distinct file_url from tb_software
        <where>
            1=1
            <if test="fileName!=null&amp;&amp;fileName!=''">
            and file_name like '%${fileName}%'
            </if>
            <if test="applyMaterialCode!=null&amp;&amp;applyMaterialCode!=''">
                and apply_material_code like '%${applyMaterialCode}%'
            </if>
            <if test="applyModel!=null&amp;&amp;applyModel!=''">
                and apply_model like '%${applyModel}%'
            </if>
            <if test="owner!=null&amp;&amp;owner!=''">
                and owner like '%${owner}%'
            </if>
            <if test="boardNumber!=null&amp;&amp;boardNumber!=''">
                and board_number like '%${boardNumber}%'
            </if>
        </where>
    </select>
    <select id="selectSoftWare" resultType="software">
        select * from tb_software where file_url=#{fileUrl}
    </select>
</mapper>