123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <?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.hssx.cloudmodel.mapper.MouldFileMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.hssx.cloudmodel.entity.MouldFile">
- <id column="id" property="id" />
- <result column="uplodtor_id" property="uplodtorId" />
- <result column="uploadtor" property="uploadtor" />
- <result column="indate" property="indate" />
- <result column="model_id" property="modelId" />
- <result column="sparepart_id" property="sparepartId" />
- <result column="project_id" property="projectId" />
- <result column="file_url" property="fileUrl" />
- <result column="file_name" property="fileName" />
- <result column="blong_type" property="blongType" />
- <result column="content" property="content" />
- <result column="state" property="state" />
- <result column="file_type" property="fileType" />
- <result column="file_size" property="fileSize" />
- <result column="file_url_2" property="fileUrl2" />
- <result column="file_name_2" property="fileName2" />
- <result column="file_type_2" property="fileType2" />
- <result column="file_size_2" property="fileSize2" />
- <result column="dwg_type" property="dwgType" />
- <result column="part_id" property="partId" />
- <result column="is_update" property="isUpdate" />
- </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>
- <collection property="maintainFiles" javaType="java.util.List" ofType="com.hssx.cloudmodel.entity.MouldFile"
- select="queryMaintainFilesByMouldId" column="id">
- </collection>
- </resultMap>
- <resultMap id="BaseResultMapApprovedVO" 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="queryApprovedMould2DFilesByMouldId" column="id">
- </collection>
- <collection property="mould3DFiles" javaType="java.util.List" ofType="com.hssx.cloudmodel.entity.MouldFile"
- select="queryApprovedMould3DFilesByMouldId" column="id">
- </collection>
- <collection property="sparepart2DFiles" javaType="java.util.List" ofType="com.hssx.cloudmodel.entity.MouldFile"
- select="queryApprovedSparepart2DFilesByMouldId" column="id">
- </collection>
- <collection property="sparepart3DFiles" javaType="java.util.List" ofType="com.hssx.cloudmodel.entity.MouldFile"
- select="queryApprovedSparepart3DFilesByMouldId" column="id">
- </collection>
- <collection property="maintainFiles" javaType="java.util.List" ofType="com.hssx.cloudmodel.entity.MouldFile"
- select="queryApprovedMaintainFilesByMouldId" 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,part_id
- </sql>
- <select id="getFileListByProjectId" resultMap="BaseResultMapVO">
- select
- id,model_no,model_name
- from
- tb_mould
- <where>
- project_id in
- <foreach collection="list" index="index" open="(" item="item" close=")" separator=",">
- #{item}
- </foreach>
- <if test="userVO.keyName != null and userVO.keyName != ''">
- and model_name like concat('%',#{userVO.keyName},'%')
- </if>
- </where>
- </select>
- <select id="getFileListByMouldId" resultMap="BaseResultMapApprovedVO">
- select
- id,model_no,model_name
- from
- tb_mould
- <where>
- id = #{id}
- </where>
- </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="queryApprovedSparepart3DFilesByMouldId" 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
- and
- state = 3
- </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="queryApprovedSparepart2DFilesByMouldId" 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
- and
- state = 3
- </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="queryApprovedMould3DFilesByMouldId" 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
- and
- state = 3
- </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>
- <select id="queryMaintainFilesByMouldId" 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
- from
- tb_mould_file
- where
- model_id = #{id}
- and
- blong_type = 3
- </select>
- <select id="queryApprovedMaintainFilesByMouldId" 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
- from
- tb_mould_file
- where
- model_id = #{id}
- and
- blong_type = 3
- and
- state = 3
- </select>
- </mapper>
|