whyclxw
2025-03-13 aca4324415aba0e5462ae6462ca8d99ca282b71c
src/main/resources/mapper/SoftwareMapper.xml
@@ -2,15 +2,28 @@
<!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">
        <result column="file_url" property="fileUrl" />
        <result column="lock_flag" property="lockFlag"/>
        <result column="file_name" property="fileName"/>
        <collection property="softwares" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Software" column="{fileUrl = file_url,lockFlag = lock_flag}" select="selectSoftWare">
        </collection>
    </resultMap>
    <select id="getFileUrl" resultMap="softwares">
        select  distinct file_url from tb_software
        select  distinct file_url,lock_flag,file_name from tb_software
        <where>
            1=1
            <choose>
                <when test="lockFlag == 0">
                    and lock_flag = 0
                </when>
                <when test="lockFlag == 12">
                    and lock_flag != 0
                </when>
                <when test="lockFlag == -1">
                    and lock_flag = -1
                </when>
            </choose>
            <if test="fileName!=null&amp;&amp;fileName!=''">
            and file_name like '%${fileName}%'
            </if>
@@ -26,9 +39,19 @@
            <if test="boardNumber!=null&amp;&amp;boardNumber!=''">
                and board_number like '%${boardNumber}%'
            </if>
            <if test="version!=null&amp;&amp;version!=''">
                and version = #{version}
            </if>
        </where>
        order by font_update_time desc
    </select>
    <select id="selectSoftWare" resultType="software">
        select * from tb_software where file_url=#{fileUrl}
        select * from tb_software where file_url=#{fileUrl} and lock_flag = #{lockFlag}
    </select>
    <select id="getFileNameByOwnerWithCode" resultType="com.whyc.pojo.Software">
        SELECT distinct file_name,based_version,owner
        FROM tb_software w
        LEFT JOINtb_softcode c ON w.file_name = c.file_name
        WHERE c.file_name IS NULL;
    </select>
</mapper>