FaultDao.xml 840 B

12345678910111213141516171819202122232425
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.zglc.kg.dao.FaultDao">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.zglc.kg.entity.FaultEntity" id="faultMap">
  6. <result property="id" column="id"/>
  7. <result property="fault_name" column="fault_name"/>
  8. <result property="describes" column="describes"/>
  9. <result property="remarks" column="remarks"/>
  10. </resultMap>
  11. <select id="listAll" resultMap="faultMap">
  12. select *
  13. from t_fault
  14. where id > 0
  15. </select>
  16. <select id="findByName" parameterType="String" resultMap="faultMap">
  17. select * from t_fault
  18. where fault_name like #{name}
  19. </select>
  20. </mapper>