92 lines
3.5 KiB
XML
92 lines
3.5 KiB
XML
<?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.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper">
|
|
|
|
<resultMap id="FileInfoResultMap" type="com.electromagnetic.industry.software.manage.pojo.other.FileInfoVO">
|
|
<id column="id" property="id"/>
|
|
<result column="file_id" property="fileId"/>
|
|
<result column="file_type" property="fileType"/>
|
|
<result column="file_name" property="fileName"/>
|
|
<result column="file_note" property="fileNote"/>
|
|
<result column="file_version" property="fileVersion"/>
|
|
<result column="parent_id" property="parentId"/>
|
|
<result column="category_id" property="categoryId"/>
|
|
<result column="data_type" property="dataType"/>
|
|
<result column="data_own" property="dataOwn"/>
|
|
<result column="data_status" property="dataStatus"/>
|
|
<result column="save_status" property="saveStatus"/>
|
|
<result column="file_size" property="fileSize"/>
|
|
<result column="file_size_show" property="fileSizeShow"/>
|
|
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP"/>
|
|
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
|
<result column="file_code" property="fileCode"/>
|
|
<result column="created_by" property="createdBy"/>
|
|
</resultMap>
|
|
|
|
<select id="queryFileList" resultMap="FileInfoResultMap">
|
|
SELECT *, LEFT(file_code, 6 ) as category_id
|
|
FROM ed_file_info
|
|
<where>
|
|
|
|
<if test="ids != null and ids.size() > 0">
|
|
AND id IN
|
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
<if test="ids == null or ids.size() == 0">
|
|
AND 1 = 0 <!-- 添加一个永远为假的条件 -->
|
|
</if>
|
|
<if test="pars.dataStatus != null">
|
|
AND data_status = #{pars.dataStatus}
|
|
</if>
|
|
|
|
<if test="pars.fileType != null and pars.fileType != ''">
|
|
AND file_type = #{pars.fileType}
|
|
</if>
|
|
|
|
AND save_status = #{saveStatus}
|
|
AND effect_flag = #{effectFlag}
|
|
</where>
|
|
|
|
<choose>
|
|
<when test="pars.fileNameSort == 0">
|
|
ORDER BY file_name ASC
|
|
</when>
|
|
|
|
<when test="pars.fileNameSort == 1">
|
|
ORDER BY file_name DESC
|
|
</when>
|
|
|
|
<when test="pars.fileTypeSort == 0">
|
|
ORDER BY file_type ASC
|
|
</when>
|
|
<when test="pars.fileTypeSort == 1">
|
|
ORDER BY file_type DESC
|
|
</when>
|
|
<when test="pars.createdTime == 0">
|
|
ORDER BY created_time ASC
|
|
</when>
|
|
<when test="pars.createdTime == 1">
|
|
ORDER BY created_time DESC
|
|
</when>
|
|
<when test="pars.versionSort == 0">
|
|
ORDER BY file_version ASC
|
|
</when>
|
|
<when test="pars.versionSort == 1">
|
|
ORDER BY file_version DESC
|
|
</when>
|
|
<when test="pars.fileSizeSort == 0">
|
|
ORDER BY file_size ASC
|
|
</when>
|
|
<when test="pars.fileSizeSort == 1">
|
|
ORDER BY file_size DESC
|
|
</when>
|
|
<otherwise>
|
|
ORDER BY created_time DESC
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
|
|
</mapper> |