publicinterfaceIndustryMapper{
intinsert(Industry industry);voidupdateById(Industry industry);voiddeleteById(Integer id);@Select("select * from `industry` where id = #{id}")IndustryselectById(Integer id);List<Industry>selectAll(Industry industry);}<!DOCTYPE mapper
PUBLIC"-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace="com.example.mapper.IndustryMapper"><select id="selectAll" resultType="com.example.entity.Industry">
select * from `industry`
<where><if test="name != null"> and title like concat('%', #{
name},'%')</if></where></select><delete id="deleteById">
delete from `industry`