无关风月
2 天以前 eaef137e2a787d55f5d31b39ec3a104675368579
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
<?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.system.mapper.AssetAdMaterialPriceMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.AssetAdMaterialPrice">
        <id column="id" property="id" />
        <result column="material_name" property="materialName" />
        <result column="unit_price" property="unitPrice" />
        <result column="price_unit" property="priceUnit" />
        <result column="remarks" property="remarks" />
        <result column="create_time" property="createTime" />
        <result column="create_by" property="createBy" />
        <result column="update_time" property="updateTime" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, material_name, unit_price, price_unit, remarks, create_time, create_by, update_time, update_by, disabled
    </sql>
 
    <!-- 分页查询 -->
    <select id="getPageList" resultType="com.ruoyi.system.vo.asset.AssetAdMaterialPriceVO">
        SELECT
            id,
            material_name,
            dept_id,
            unit_price,
            price_unit,
            remarks,
            create_time,
            create_by,
            update_time,
            update_by
        FROM asset_ad_material_price aamp LEFT JOIN t_dept td ON aamp.dept_id = td.id
        <where>
            disabled = 0
            <if test="query.materialName != null and query.materialName != ''">
                AND material_name LIKE CONCAT('%', #{query.materialName}, '%')
            </if>
            <if test="query.deptId != null">
                AND (td.id = #{query.deptId} OR FIND_IN_SET(#{query.deptId}, od.parent_id))
            </if>
        </where>
        ORDER BY create_time DESC
    </select>
 
</mapper>