Files
GEAR-OA/gear-mat/src/main/resources/mapper/MatPriceHistoryMapper.xml

45 lines
1.8 KiB
XML
Raw Normal View History

<?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.gear.mat.mapper.MatPriceHistoryMapper">
<resultMap type="com.gear.mat.domain.MatPriceHistory" id="MatMatPriceHistoryResult">
<result property="historyId" column="history_id"/>
<result property="materialId" column="material_id"/>
<result property="price" column="price"/>
<result property="avgPrice" column="avg_price"/>
<result property="quantity" column="quantity"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
</resultMap>
<select id="selectVoPagePlus" resultType="com.gear.mat.domain.vo.MatPriceHistoryVo">
SELECT
t.history_id AS historyId,
t.material_id AS materialId,
t.price AS price,
t.avg_price AS avgPrice,
t.quantity AS quantity,
t.create_time AS createTime,
t.create_by AS createBy,
t.update_time AS updateTime,
t.update_by AS updateBy,
t.remark AS remark,
mm.material_name AS materialName,
mm.spec AS spec,
mm.model AS model,
mm.factory AS factory,
mm.unit AS unit,
mm.current_stock AS currentStock
FROM mat_mat_price_history t
LEFT JOIN mat_material mm ON t.material_id = mm.material_id AND mm.del_flag = 0
${ew.customSqlSegment}
</select>
</mapper>