|
@@ -24,10 +24,92 @@
|
|
|
<result column="file_size_2" property="fileSize2" />
|
|
|
<result column="dwg_type" property="dwgType" />
|
|
|
</resultMap>
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResultMapVO" type="com.hssx.cloudmodel.entity.vo.MouldFileVO">
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="model_no" property="modelNo"/>
|
|
|
+ <result column="model_name" property="modelName"/>
|
|
|
+ <collection property="mould2DFiles" javaType="java.util.List" ofType="com.hssx.cloudmodel.entity.MouldFile"
|
|
|
+ select="queryMould2DFilesByMouldId" column="id">
|
|
|
+ </collection>
|
|
|
+ <collection property="mould3DFiles" javaType="java.util.List" ofType="com.hssx.cloudmodel.entity.MouldFile"
|
|
|
+ select="queryMould3DFilesByMouldId" column="id">
|
|
|
+ </collection>
|
|
|
+ <collection property="sparepart2DFiles" javaType="java.util.List" ofType="com.hssx.cloudmodel.entity.MouldFile"
|
|
|
+ select="querySparepart2DFilesByMouldId" column="id">
|
|
|
+ </collection>
|
|
|
+ <collection property="sparepart3DFiles" javaType="java.util.List" ofType="com.hssx.cloudmodel.entity.MouldFile"
|
|
|
+ select="querySparepart3DFilesByMouldId" column="id">
|
|
|
+ </collection>
|
|
|
+ </resultMap>
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
id, uplodtor_id, uploadtor, indate, model_id, sparepart_id, project_id, file_url, file_name, blong_type, content, state, file_type, file_size, file_url_2, file_name_2, file_type_2, file_size_2, dwg_type
|
|
|
</sql>
|
|
|
|
|
|
+ <select id="getFileListByProjectId" resultMap="BaseResultMapVO">
|
|
|
+ select
|
|
|
+ id,model_no,model_name
|
|
|
+ from
|
|
|
+ tb_mould
|
|
|
+ where
|
|
|
+ project_id = #{userVO.projectId}
|
|
|
+ </select>
|
|
|
+ <select id="querySparepart3DFilesByMouldId" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ id, uplodtor_id, uploadtor, indate, model_id, sparepart_id,
|
|
|
+ project_id, file_url, file_name, blong_type, content, state,
|
|
|
+ file_type, file_size, dwg_type
|
|
|
+ from
|
|
|
+ tb_mould_file
|
|
|
+ where
|
|
|
+ model_id = #{id}
|
|
|
+ and
|
|
|
+ blong_type = 1
|
|
|
+ and
|
|
|
+ dwg_type = 1
|
|
|
+ </select>
|
|
|
+ <select id="querySparepart2DFilesByMouldId" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ id, uplodtor_id, uploadtor, indate, model_id, sparepart_id,
|
|
|
+ project_id, file_url, file_name, blong_type, content, state,
|
|
|
+ file_type, file_size, dwg_type
|
|
|
+ from
|
|
|
+ tb_mould_file
|
|
|
+ where
|
|
|
+ model_id = #{id}
|
|
|
+ and
|
|
|
+ blong_type = 1
|
|
|
+ and
|
|
|
+ dwg_type = 0
|
|
|
+ </select>
|
|
|
+ <select id="queryMould3DFilesByMouldId" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ id, uplodtor_id, uploadtor, indate, model_id, sparepart_id,
|
|
|
+ project_id, file_url, file_name, blong_type, content, state,
|
|
|
+ file_type, file_size, dwg_type
|
|
|
+ from
|
|
|
+ tb_mould_file
|
|
|
+ where
|
|
|
+ model_id = #{id}
|
|
|
+ and
|
|
|
+ blong_type = 0
|
|
|
+ and
|
|
|
+ dwg_type = 1
|
|
|
+ </select>
|
|
|
+ <select id="queryMould2DFilesByMouldId" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ id, uplodtor_id, uploadtor, indate, model_id, sparepart_id,
|
|
|
+ project_id, file_url, file_name, blong_type, content, state,
|
|
|
+ file_type, file_size, dwg_type
|
|
|
+ from
|
|
|
+ tb_mould_file
|
|
|
+ where
|
|
|
+ model_id = #{id}
|
|
|
+ and
|
|
|
+ blong_type = 0
|
|
|
+ and
|
|
|
+ dwg_type = 0
|
|
|
+ </select>
|
|
|
</mapper>
|