zss
13 小时以前 3d4cb4fafdee76f0dc2f895f21a37bfa0f638c6a
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
<?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.ruoyi.production.mapper.ProductBomMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.production.pojo.ProductBom">
        <id column="id" property="id"/>
        <result column="product_model_id" property="productModelId"/>
        <result column="bom_no" property="bomNo"/>
        <result column="remark" property="remark"/>
        <result column="version" property="version"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="create_user" property="createUser"/>
        <result column="update_user" property="updateUser"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>
    <select id="listPage" resultType="com.ruoyi.production.dto.ProductBomDto">
        select * from (select pb.*,
        pm.model productModelName,
        p.product_name productName
        from product_bom pb
        left join product_model pm on pb.product_model_id = pm.id
        left join product p on pm.product_id = p.id)A
        where 1=1
        <if test="c.productModelName != null">
            and productModelName = #{c.productModelName}
        </if>
        <if test="c.productName != null">
            and productName = #{c.productName}
        </if>
        <if test="c.bomNo != null">
            and bom_no = #{c.bomNo}
        </if>
        <if test="c.version != null">
            and version = #{c.version}
        </if>
    </select>
    <select id="getById" resultType="com.ruoyi.production.dto.ProductBomDto">
        select pb.*,
               pm.model productModelName,
               p.product_name productName
        from product_bom pb
                 left join product_model pm on pb.product_model_id = pm.id
                 left join product p on pm.product_id = p.id
    </select>
 
</mapper>