1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?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="org.jeecg.modules.dnc.mapper.PartsInfoMapper">
    <select id="getByUserPerms" resultType="org.jeecg.modules.dnc.entity.PartsInfo" parameterType="String">
        select p.parts_id
        , p.parts_name
        , p.product_id
        , p.component_id
        , p.materiel_code
        , p.materiel_desp
        , p.parts_model
        , p.parts_scale
        , p.parts_weight
        , p.assemble_type
        , p.produce_type
        , p.process_type
        , p.structure_type
        , p.parts_code
        , p.parts_status
        , p.description
        , p.CREATE_TIME
        , p.create_by
        , p.UPDATE_TIME
        , p.update_by
        , (select sys_user.realname from sys_user where p.create_by=sys_user.username) as createName
        , (select sys_user.realname from sys_user where p.update_by=sys_user.username) as updateName
        from nc_parts_info p
        inner join
             (select business_id,business_type from nc_permission_stream_new where delete_flag = 0 and user_id=#{userId}) s
             on p.parts_id = s.business_id and s.business_type='3'
        where p.delete_flag = 0
    </select>
</mapper>