| | |
| | | <!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&&fileName!=''"> |
| | | and file_name like '%${fileName}%' |
| | | </if> |
| | |
| | | <if test="owner!=null&&owner!=''"> |
| | | and owner like '%${owner}%' |
| | | </if> |
| | | <if test="boardNumber!=null&&boardNumber!=''"> |
| | | and board_number like '%${boardNumber}%' |
| | | </if> |
| | | <if test="version!=null&&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 w.file_name,based_version,owner,version |
| | | FROM tb_software w |
| | | LEFT JOIN tb_softcode c ON w.file_name = c.file_name |
| | | WHERE c.file_name IS NULL |
| | | and w.owner = #{owner}; |
| | | </select> |
| | | </mapper> |