2022-07-20 15:14:39 +08:00
|
|
|
<?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.cnbm.basic.mapper.ProductFeaturesMapper">
|
|
|
|
|
2022-08-09 15:16:12 +08:00
|
|
|
<select id="getProductFeaturesByProductId" resultType="com.cnbm.basic.dto.ProductFeaturesDTO">
|
2022-09-02 16:21:20 +08:00
|
|
|
select p.*,m.name as measureToolName,u.name as unitName,c.name as controlGraphName
|
2022-08-09 15:16:12 +08:00
|
|
|
from product_features p
|
|
|
|
LEFT JOIN measure_tool m ON p.measure_tool_id=m.id
|
|
|
|
LEFT JOIN unit u ON p.unit_id=u.id
|
|
|
|
LEFT JOIN control_graph c ON p.control_graph_id=c.id
|
|
|
|
<where>
|
|
|
|
p.valid = 1 AND p.product_id = #{id}
|
|
|
|
</where>
|
|
|
|
order by p.id asc
|
|
|
|
</select>
|
|
|
|
|
2022-09-02 16:21:20 +08:00
|
|
|
<select id="getFeaturesByStageProcedure" resultType="com.cnbm.basic.dto.ProductFeaturesDTO">
|
|
|
|
select *
|
|
|
|
from product_features pf
|
|
|
|
LEFT JOIN features_stage_procedure_relation fspr ON pf.id=fspr.product_features_id
|
|
|
|
<where>
|
|
|
|
fspr.valid = 1
|
|
|
|
<if test="inspectionStage != null">
|
|
|
|
and fspr.inspection_stage = #{inspectionStage}
|
|
|
|
</if>
|
|
|
|
<if test="workingProcedureId != null">
|
|
|
|
and fspr.working_procedure_id = #{workingProcedureId}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
order by pf.id asc
|
|
|
|
</select>
|
2022-07-20 15:14:39 +08:00
|
|
|
</mapper>
|