DeviceDao.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.vm.dao.DeviceDao">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.zglc.vm.entity.DeviceEntity" id="deviceMap">
  6. <result property="id" column="id"/>
  7. <result property="device_name" column="device_name"/>
  8. <result property="device_type" column="device_type"/>
  9. <result property="software_version" column="software_version"/>
  10. <result property="s_update_reason" column="s_update_reason"/>
  11. <result property="s_update_time" column="s_update_time"/>
  12. <result property="s_file_num" column="s_file_num"/>
  13. <result property="hardware_version" column="hardware_version"/>
  14. <result property="h_update_reason" column="h_update_reason"/>
  15. <result property="h_update_time" column="h_update_time"/>
  16. <result property="h_file_num" column="h_file_num"/>
  17. <result property="update_test" column="update_test"/>
  18. <result property="update_user" column="update_user"/>
  19. <result property="equipment_id" column="equipment_id"/>
  20. <result property="syst_id" column="syst_id"/>
  21. <result property="subsys_id" column="subsys_id"/>
  22. </resultMap>
  23. <!-- <select id="listAll" resultMap="userMap">-->
  24. <!-- select *-->
  25. <!-- from t_device-->
  26. <!-- where id > 1-->
  27. <!-- </select>-->
  28. <select id="getCount" resultType="java.lang.Integer">
  29. select count(1)
  30. from t_device
  31. </select>
  32. <select id="getLastInsert" resultMap="deviceMap">
  33. SELECT * FROM t_device ORDER BY id DESC LIMIT 1
  34. </select>
  35. <select id="findByName" parameterType="String" resultMap="deviceMap">
  36. select * FROM t_device where device_name like #{name}
  37. </select>
  38. <!-- <select id="findByName1" parameterType="com.zglc.vm.entity.DeviceFind" resultMap="deviceMap">-->
  39. <!-- select * FROM t_device where device_name like #{name} and device_type = #{deviceType}-->
  40. <!-- </select>-->
  41. <select id="findByAir" parameterType="Integer" resultMap="deviceMap">
  42. select * FROM t_device where equipment_id = #{airId}
  43. </select>
  44. <select id="findByAir1" parameterType="Integer" resultMap="deviceMap">
  45. select * FROM t_device where equipment_id = #{airId} and device_type = #{deviceType}
  46. </select>
  47. <select id="findBySys" parameterType="Integer" resultMap="deviceMap">
  48. select * FROM t_device where syst_id = #{sysId}
  49. </select>
  50. <select id="findBySys1" parameterType="Integer" resultMap="deviceMap">
  51. select * FROM t_device where syst_id = #{sysId} and device_type = #{deviceType}
  52. </select>
  53. <select id="findBySubSys" parameterType="Integer" resultMap="deviceMap">
  54. select * FROM t_device where subsys_id = #{subSysId}
  55. </select>
  56. </mapper>