123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?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.PartMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.hssx.cloudmodel.entity.Part">
- <id column="id" property="id" />
- <result column="part_no" property="partNo" />
- <result column="part_name" property="partName" />
- <result column="indate" property="indate" />
- <result column="part_life" property="partLife" />
- <result column="is_vulnerable" property="isVulnerable" />
- <result column="creator_id" property="creatorId" />
- <result column="creator" property="creator" />
- <result column="mould_id" property="mouldId" />
- </resultMap>
- <resultMap id="BaseResultMapVO" type="com.hssx.cloudmodel.entity.vo.PartVO">
- <id column="id" property="id" />
- <result column="part_no" property="partNo" />
- <result column="part_name" property="partName" />
- <result column="indate" property="indate" />
- <result column="part_life" property="partLife" />
- <result column="is_vulnerable" property="isVulnerable" />
- <result column="creator_id" property="creatorId" />
- <result column="creator" property="creator" />
- <result column="mould_id" property="mouldId" />
- <result column="state" property="state" />
- <association property="part2dFile" javaType="com.hssx.cloudmodel.entity.MouldFile" column="id" select="getPart2dFileByPartId">
- </association>
- <association property="part3dFile" javaType="com.hssx.cloudmodel.entity.MouldFile" column="id" select="getPart3dFileByPartId">
- </association>
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, part_no, part_name, indate, part_life, is_vulnerable, creator_id, creator, mould_id
- </sql>
- <select id="selectPartFileByMouldId" resultMap="BaseResultMapVO">
- select
- tbp.id, tbp.part_no, tbp.part_name, tbmf.indate, tbp.part_life, tbp.is_vulnerable, tbp.creator_id, tbp.creator, tbp.mould_id,tbmf.state
- from
- tb_part tbp
- left join
- tb_mould_file tbmf
- on tbmf.part_id = tbp.id
- where
- mould_id = #{userVO.mouldId}
- group by tbp.id
- </select>
- <select id="getPart2dFileByPartId" resultType="com.hssx.cloudmodel.entity.MouldFile">
- 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, part_id
- from
- tb_mould_file
- where
- part_id = #{id}
- and dwg_type = 0
- </select>
- <select id="getPart3dFileByPartId" resultType="com.hssx.cloudmodel.entity.MouldFile">
- 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, part_id
- from
- tb_mould_file
- where
- part_id = #{id}
- and dwg_type = 1
- </select>
- </mapper>
|