|
@@ -158,20 +158,23 @@
|
|
|
|
|
|
<select id="getSpareList" parameterType="com.platform.dao.dto.sb.SbInfoDTO"
|
|
<select id="getSpareList" parameterType="com.platform.dao.dto.sb.SbInfoDTO"
|
|
resultType="com.platform.dao.vo.sb.SbModelSpareBomVO">
|
|
resultType="com.platform.dao.vo.sb.SbModelSpareBomVO">
|
|
- SELECT sb.id as id,sb.status as status, sb.name AS sbName,sb.position_no AS positionNo,position.name AS positionName,bom.num AS num,bom.spare_name AS spareName,bom.ggxh AS ggxh,bom.no AS no FROM t_sb_info sb
|
|
|
|
|
|
+ SELECT bom. id as id,sb.id as sbId,sb.status as status, sb.name AS sbName,sb.position_no AS positionNo,position.name AS positionName,bom.num AS num,bom.spare_name AS spareName,bom.ggxh AS ggxh,bom.no AS no FROM t_sb_info sb
|
|
LEFT JOIN t_sb_position POSITION ON sb.position_id = position.id
|
|
LEFT JOIN t_sb_position POSITION ON sb.position_id = position.id
|
|
inner JOIN t_sb_model_spare_bom bom ON bom.sb_id = sb.id
|
|
inner JOIN t_sb_model_spare_bom bom ON bom.sb_id = sb.id
|
|
<where>
|
|
<where>
|
|
<if test="typeId!=null and typeId!=''">
|
|
<if test="typeId!=null and typeId!=''">
|
|
and sb.type_id = #{typeId}
|
|
and sb.type_id = #{typeId}
|
|
</if>
|
|
</if>
|
|
- <if test="positionId!=null and postionId!=''">
|
|
|
|
- and sb.postion_id = #{positionId}
|
|
|
|
|
|
+ <if test="positionId!=null and positionId!=''">
|
|
|
|
+ and sb.position_id = #{positionId}
|
|
</if>
|
|
</if>
|
|
<if test="keyword!=null and keyword!=''">
|
|
<if test="keyword!=null and keyword!=''">
|
|
and (sb.name like concat('%',#{keyword},'%')
|
|
and (sb.name like concat('%',#{keyword},'%')
|
|
or sb.position_no like concat('%',#{keyword},'%')
|
|
or sb.position_no like concat('%',#{keyword},'%')
|
|
- bom.spare_name like concat('%',#{keyword},'%'))
|
|
|
|
|
|
+ or bom.spare_name like concat('%',#{keyword},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="positionNo!=null and positionNo!=''">
|
|
|
|
+ and sb.position_no like concat('%',#{positionNo},'%')
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|