CardDao.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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.fm.dao.master.CardDao">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.zglc.fm.entity.CardEntity" id="cardMap">
  6. <result property="id" column="id"/>
  7. <result property="card_name" column="card_name"/>
  8. <result property="aircraft_type" column="aircraft_type"/>
  9. <result property="major_type" column="major_type"/>
  10. <result property="description" column="description"/>
  11. <result property="file_path" column="file_path"/>
  12. <result property="input_time" column="input_time"/>
  13. <result property="remarks" column="remarks"/>
  14. </resultMap>
  15. <select id="listAll" resultMap="cardMap">
  16. select id,card_name,aircraft_type,major_type,description,file_path,input_time,remarks
  17. from t_card
  18. where id > 0
  19. </select>
  20. <select id="getCount" resultType="java.lang.Integer">
  21. select count(1)
  22. from t_card
  23. where id > 1
  24. </select>
  25. <!-- <insert id="batchAdd" parameterType="java.util.List">-->
  26. <!-- <foreach collection="list" item="equ" separator=";">-->
  27. <!-- insert into t_equipment (equipment_type)-->
  28. <!-- SELECT #{equ.equipment_type}-->
  29. <!-- FROM DUAL WHERE NOT EXISTS (SELECT equipment_type FROM t_equipment WHERE equipment_type = #{equ.equipment_type})-->
  30. <!-- </foreach>-->
  31. <!-- </insert>-->
  32. <select id="findByName" parameterType="String" resultMap="cardMap">
  33. select id,card_name,aircraft_type,major_type,description,file_path,input_time,remarks from t_card where card_name
  34. like #{card_name}
  35. </select>
  36. </mapper>