<?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
|
aamp.id,
|
aamp.material_name,
|
aamp.dept_id,
|
aamp.unit_price,
|
aamp.price_unit,
|
aamp.remarks,
|
aamp.create_time,
|
aamp.create_by,
|
aamp.update_time,
|
aamp.update_by
|
FROM asset_ad_material_price aamp LEFT JOIN t_dept td ON aamp.dept_id = td.id
|
<where>
|
aamp.disabled = 0
|
<if test="query.materialName != null and query.materialName != ''">
|
AND aamp.material_name LIKE CONCAT('%', #{query.materialName}, '%')
|
</if>
|
<if test="query.deptId != null">
|
AND (td.id = #{query.deptId} OR FIND_IN_SET(#{query.deptId}, td.parent_id))
|
</if>
|
</where>
|
ORDER BY aamp.create_time DESC
|
</select>
|
|
</mapper>
|