| | |
| | | <mapper namespace="cn.huge.module.file.dao.mapper.FileInfoMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.file.domain.po.FileInfo"> |
| | | <result property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="trueName" column="true_name"/> |
| | | <result property="fileName" column="file_name"/> |
| | | <result property="suffix" column="suffix"/> |
| | | <result property="cat" column="cat"/> |
| | | <result property="size" column="size"/> |
| | | <result property="unit" column="unit"/> |
| | | <result property="md5Code" column="md5_code"/> |
| | | <result property="storeWay" column="store_way"/> |
| | | <result property="path" column="path"/> |
| | | <result property="fullPath" column="full_path"/> |
| | | <result property="showUrl" column="show_url"/> |
| | | <result property="downUrl" column="down_url"/> |
| | | <result property="zipUrl" column="zip_url"/> |
| | | <result property="deleteStatus" column="delete_status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="ownerId" column="owner_id"/> |
| | | <result property="ownerCat" column="owner_cat"/> |
| | | <result property="ownerType" column="owner_type"/> |
| | | <result property="uploaderId" column="uploader_id"/> |
| | | <result property="uploaderName" column="uploader_name"/> |
| | | </resultMap> |
| | | <resultMap id="fileResult" type="cn.huge.module.file.domain.po.FileInfo"> |
| | | <result property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="trueName" column="true_name"/> |
| | |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="ownerId" column="owner_id"/> |
| | | <result property="ownerCat" column="owner_cat"/> |
| | | <result property="ownerType" column="owner_type"/> |
| | | <result property="uploaderId" column="uploader_id"/> |
| | | <result property="uploaderName" column="uploader_name"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_file_info</sql> |
| | |
| | | cust_id, |
| | | update_time, |
| | | create_time |
| | | </sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part-t"> |
| | | t1.id, |
| | | t1.name, |
| | | t1.true_name, |
| | | t1.file_name, |
| | | t1.suffix, |
| | | t1.cat, |
| | | t1.size, |
| | | t1.unit, |
| | | t1.md5_code, |
| | | t1.store_way, |
| | | t1.path, |
| | | t1.full_path, |
| | | t1.show_url, |
| | | t1.down_url, |
| | | t1.zip_url, |
| | | t1.delete_status, |
| | | t1.cust_id, |
| | | t1.update_time, |
| | | t1.create_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | |
| | | <include refid="listFileByCatTerms-where-part"/> |
| | | </select> |
| | | |
| | | <!-- 根据多个编号查询 --> |
| | | <select id="listByids" resultMap="fileResult"> |
| | | SELECT t2.owner_id, t2.owner_cat, t2.owner_type, t2.uploader_id, t2.uploader_name, |
| | | <include refid="column-part-t"/> |
| | | FROM dyh_file_info t1 |
| | | LEFT JOIN dyh_file_relate t2 ON t1.id = t2.file_id |
| | | WHERE t2.main_id = #{mainId} |
| | | <if test="terms.ownerIds = null and terms.ownerIds =''"> |
| | | and t2.owner_id in (${ownerIds}) |
| | | </if> |
| | | <if test="terms.types = null and terms.types =''"> |
| | | and t2.owner_type in (${types}) |
| | | </if> |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | <!-- 根据多个编号查询 --> |
| | | <select id="listByIdsTypes" resultMap="fileResult"> |
| | | SELECT t2.owner_id, t2.owner_cat, t2.owner_type, t2.uploader_id, t2.uploader_name, |
| | | <include refid="column-part-t"/> |
| | | FROM dyh_file_info t1 |
| | | LEFT JOIN dyh_file_relate t2 ON t1.id = t2.file_id |
| | | WHERE t2.owner_id in (${ownerIds}) |
| | | and t2.main_id = #{mainId} |
| | | and t2.owner_type in (${types}) |
| | | </select> |
| | | </mapper> |