EnvDeviceMapper.xml 986 B

123456789101112131415161718192021222324252627
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhgd.scs.mapper.EnvDeviceMapper">
  6. <select id="getList" resultType="com.zhgd.scs.domain.EnvDevice">
  7. SELECT * FROM env_device
  8. WHERE project_id=#{projectId}
  9. <if test="devid!=null and devid!=''">
  10. AND devid LIKE concat('%',#{devid},'%')
  11. </if>
  12. <if test="name!=null and name!=''">
  13. AND dev_name LIKE concat('%',#{name},'%')
  14. </if>
  15. <if test="startTime!=null and endTime!=null">
  16. AND in_time BETWEEN #{startTime} AND #{endTime}
  17. </if>
  18. <if test="state != null">
  19. AND state = #{state}
  20. </if>
  21. <if test="inOutState != null">
  22. AND in_out_state = #{inOutState}
  23. </if>
  24. ORDER BY in_out_state DESC, state DESC, in_time DESC,id DESC
  25. </select>
  26. </mapper>