chenhj
2026-04-21 1bbe6f787d58b768dce5370aa4e0d242c5e4b62d
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
<?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.technology.mapper.TechnologyBomMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.technology.pojo.TechnologyBom">
        <id column="id" property="id" />
        <result column="product_model_id" property="productModelId" />
        <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="bom_no" property="bomNo" />
        <result column="dept_id" property="deptId" />
    </resultMap>
 
    <select id="listPage" resultType="com.ruoyi.technology.bean.vo.TechnologyBomVo">
        select tb.*,
               pm.model as productModelName,
               p.product_name as productName
        from technology_bom tb
        left join product_model pm on tb.product_model_id = pm.id
        left join product p on pm.product_id = p.id
        <where>
            <if test="c.productModelName != null and c.productModelName != ''">
                and pm.model like concat('%', #{c.productModelName}, '%')
            </if>
            <if test="c.productName != null and c.productName != ''">
                and p.product_name like concat('%', #{c.productName}, '%')
            </if>
            <if test="c.bomNo != null and c.bomNo != ''">
                and tb.bom_no like concat('%', #{c.bomNo}, '%')
            </if>
            <if test="c.version != null and c.version != ''">
                and tb.version = #{c.version}
            </if>
        </where>
        order by tb.id desc
    </select>
</mapper>