value
2024-04-16 01af9cb1c94e459184ad4d9836662094f14bac7e
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
<?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.yuanchu.mom.mapper.StandardMethodMapper">
 
    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.StandardMethod">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="code" column="code" jdbcType="VARCHAR"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="remark" column="remark" jdbcType="VARCHAR"/>
        <result property="createUser" column="create_user" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateUser" column="update_user" jdbcType="INTEGER"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
 
    <select id="selectStandardMethodList" resultType="com.yuanchu.mom.pojo.StandardMethod">
        select * from (
        select sm.id,
        sm.code,
        sm.name,
        sm.structure_test_object_id,
        sto.specimen_name sample_type,
        sm.remark,
        u1.name create_user_name,
        sm.create_time,
        u2.name update_user_name,
        sm.update_time,
        sm.is_product
        from standard_method sm
        left join user u1 on sm.create_user = u1.id
        left join user u2 on sm.update_user = u2.id
        left join structure_test_object sto on sm.structure_test_object_id = sto.id
        ) a
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
</mapper>