| | |
| | | |
| | | //查询sop信息 |
| | | public Response getSopInfo(List<SopDto> sqlList, String code, String model) { |
| | | String sqlStr=" "; |
| | | String sqlStr=" "; |
| | | if(sqlList!=null&&sqlList.size()>0){ |
| | | for (SopDto dto:sqlList) { |
| | | if(dto.getChileType().size()>0){ |
| | | for (int i=0;i<dto.getChileType().size();i++){ |
| | | sqlStr+=" and file_type like "+"'%"+dto.getParentType()+"%' "; |
| | | sqlStr+=" and file_type like "+"'%"+dto.getParentType()+"-"+dto.getChileType().get(i)+"%' "; |
| | | } |
| | | } |
| | | } |
| | |
| | | </resultMap> |
| | | <select id="getSopInfo" resultMap="sopList"> |
| | | select * from tb_sop,tb_sop_product |
| | | where tb_sop.id=tb_sop_product.sop_id |
| | | and code LIKE '%${code}%' and model like '%${model}%' |
| | | ${sqlStr} |
| | | <where> |
| | | tb_sop.id=tb_sop_product.sop_id |
| | | <if test="code!=null"> |
| | | and code LIKE '%${code}%' |
| | | </if> |
| | | <if test="model!=null"> |
| | | and model LIKE '%${model}%' |
| | | </if> |
| | | ${sqlStr} |
| | | </where> |
| | | </select> |
| | | </mapper> |