| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.measuringinstrumentledger.mapper.SparePartsMapper"> |
| | | <select id="listPage" resultType="com.ruoyi.measuringinstrumentledger.dto.SparePartsDto"> |
| | | select sp.*,sp1.name as parentName from spare_parts sp |
| | | select sp.*,sp1.name as parentName |
| | | from spare_parts sp |
| | | left join spare_parts sp1 on sp1.id = sp.parent_id |
| | | <where> |
| | | <if test="spareParts.name != null"> |
| | | and name like concat('%',#{spareParts.name},'%') |
| | | <if test="spareParts.name != null and spareParts.name != ''"> |
| | | and sp.name like concat('%',#{spareParts.name},'%') |
| | | </if> |
| | | </where> |
| | | </select> |