| | |
| | | </resultMap> |
| | | <select id="selectAllMbom" resultMap="oneMap"> |
| | | select m.id mid, |
| | | m.name mname, |
| | | unit, |
| | | num, |
| | | specifications, |
| | | t.name tname, |
| | | father |
| | | m.name mname, |
| | | unit, |
| | | num, |
| | | specifications, |
| | | t.name tname, |
| | | father |
| | | from mom_ocean.mbom m |
| | | left join mom_ocean.technology t on m.technology_id = t.id |
| | | left join mom_ocean.technology t on m.technology_id = t.id |
| | | where m.state = 1 |
| | | and m.version = #{version} |
| | | and specifications_id = #{specificationsId} |
| | | and m.version = #{version} |
| | | and specifications_id = #{specificationsId} |
| | | <if test="message!=null and message!=''"> |
| | | and m.name like concat('%',#{message},'%') |
| | | and t.name like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据型号id查询该型号下所有工艺需要的物料清单--> |
| | | <select id="selAllBySpeId" resultType="com.yuanchu.mom.pojo.Mbom"> |
| | | select * |
| | | from mom_ocean.mbom |
| | | where state = 1 |
| | | and version = #{version} |
| | | and technology_id in (select id |
| | | from mom_ocean.technology |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | </select> |
| | | |
| | | <!--根据工艺路线id查询物料清单--> |
| | | <select id="seleByTechId" resultType="com.yuanchu.mom.pojo.Mbom"> |
| | | select * |
| | | from mom_ocean.mbom |
| | | where state = 1 |
| | | and technology_id = #{technologyId} |
| | | </select> |
| | | |
| | | <!--根据工艺路线id删除物料清单--> |
| | | <update id="delMbomByTecId"> |
| | | update mom_ocean.mbom |
| | | set state=0 |
| | | where technology_id = #{id} |
| | | </update> |
| | | |
| | | <!--根据工艺路线id批量删除--> |
| | | <update id="delAllByTecId"> |
| | | update mom_ocean.mbom |
| | | set state=0 |
| | | where technology_id in (${ids}) |
| | | </update> |
| | | |
| | | <!--根据物料清单id批量删除--> |
| | | <update id="delAllMbom"> |
| | | update mom_ocean.mbom |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | </mapper> |