cuijian
2025-06-16 e0529614c187a5457ca3f587a16edeec51d69d15
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?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.tms.mapper.OutStoreDetailMapper">
 
    <select id="queryPageList" resultType="org.jeecg.modules.tms.entity.vo.OutStoreDetailVo">
        SELECT
            t1.id,
            t2.tool_code toolCode,
            t1.tool_id toolId,
            t1.out_storehouse_type outStorehouseType,
            t1.goods_shelves_code goodsShelvesCode,
            t1.out_number outNumber,
            t1.out_storehouse_id outStorehouseId,
            case t1.operate_type
                when '1' then '申请单'
                when '2' then '手工操作'
                else ''
            end operateType,
            t1.create_by createBy,
            t1.create_time createTime,
            t1.rated_life ratedLife,
            t1.use_life useLife,
            t1.remaining_percentage remainingPercentage,
            t2.chinese_name chineseName,
            t2.tool_model toolModel,
            t2.parama_table_name paramaTableName,
            case t3.application_type
                when '1' then '通用工具'
                when '2' then '专用工具'
                else ''
            end applicationType,
        <choose>
            <when test="ew.paramNameValuePairs.paramaTableName == '1'">
                t4.tool_material toolMaterial,
                t4.part_material partMaterial
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '2'">
                t5.tool_material toolMaterial,
                t5.part_material partMaterial
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '3'">
                t6.tool_material toolMaterial,
                t6.part_material partMaterial
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '4'">
                t7.tool_material toolMaterial,
                t7.part_material partMaterial
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '5'">
                t8.tool_material toolMaterial,
                t8.part_material partMaterial
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '6'">
                t9.tool_material toolMaterial,
                t9.part_material partMaterial
            </when>
            <otherwise>
                t10.tool_material toolMaterial,
                t10.part_material partMaterial
            </otherwise>
        </choose>
        FROM tms_out_store_detail t1
        LEFT JOIN tms_base_tools t2 on t1.tool_code = t2.id
        LEFT JOIN tms_tools_config_property t3 on t3.tool_code = t1.tool_code
        <choose>
            <when test="ew.paramNameValuePairs.paramaTableName == '1'">
                LEFT JOIN tms_para_common_tool t4 on t4.tool_code = t2.id
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '2'">
                LEFT JOIN tms_para_hole_tools t5 on t5.tool_code = t2.id
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '3'">
                LEFT JOIN tms_para_threading_tool t6 on t6.tool_code = t2.id
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '4'">
                LEFT JOIN tms_para_mill_tool t7 on t7.tool_code = t2.id
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '5'">
                LEFT JOIN tms_para_turning_tools t8 on t8.tool_code = t2.id
            </when>
            <when test="ew.paramNameValuePairs.paramaTableName == '6'">
                LEFT JOIN tms_para_blade t9 on t9.tool_code = t2.id
            </when>
            <otherwise>
                LEFT JOIN tms_para_common_tool t10 on t10.tool_code = t2.id
            </otherwise>
        </choose>
        ${ew.customSqlSegment}
    </select>
 
    <select id="outStoreDetailList" resultType="map" parameterType="String">
        SELECT
            t1.id,
            t1.tool_id onlyCode,
            t1.out_storehouse_type outStorehouseType,
            t1.out_number outNumber,
            t1.out_storehouse_id outStorehouseId,
            t4.outbound_time outboundTime,
            t1.create_by createBy,
            t1.create_time createTime,
            t1.update_by updateBy,
            t1.update_time updateTime,
            t2.tool_code toolCode,
            t2.chinese_name chineseName,
            t2.tool_model toolModel,
            t3.classify_id classifyNum,
            t4.out_num outNum,
            t4.subject_matter subjectMatter,
            t5.realname handler,
            t6.realname reviewer,
            t7.item_text inStatus,
            t8.item_text orderStatus,
            t9.item_text outStorehouseTypeName,
            t10.item_text operateType
        FROM
            tms_out_store_detail t1
                LEFT JOIN tms_base_tools t2 ON t2.id = t1.tool_code
                LEFT JOIN tms_tools_classify t3 ON t3.id = t2.classify_id
                LEFT JOIN tms_outbound_order t4 ON t4.id = t1.out_storehouse_id
                LEFT JOIN sys_user t5 ON t5.username = t4.handler
                LEFT JOIN sys_user t6 ON t6.username = t4.reviewer
                LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'out_status' ) t7 ON t7.item_value = t4.out_status
                LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'out_bill_status' ) t8 ON t8.item_value = t4.order_status
                LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'out_storehouse_type' ) t9 ON t9.item_value = t1.out_storehouse_type
                LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'inbound_operate_type' ) t10 ON t10.item_value = t1.operate_type
            ${ew.customSqlSegment}
    </select>
</mapper>