MesLineMapper.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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.huaxia.imes.mapper.MesLineMapper">
  6. <!--获取总条数-->
  7. <select id="countByParams" resultType="int">
  8. SELECT COUNT(*)
  9. FROM mes_line
  10. <where>
  11. <if test="params.boy != null">
  12. <if test="params.boy.lineName != null and params.boy.lineName != ''">
  13. line_name like concat('%', #{params.boy.lineName}, '%')
  14. </if>
  15. <if test="params.boy.startTime != null">
  16. and create_time gl;
  17. #{params.boy.startTime}
  18. </if>
  19. <if test="params.boy.endTime != null">
  20. and create_time le;
  21. #{params.boy.endTime}
  22. </if>
  23. </if>
  24. </where>
  25. </select>
  26. <!--开始分页查询-->
  27. <select id="queryListPage" resultType="com.huaxia.imes.pojo.MesLineVO">
  28. SELECT *
  29. FROM mes_line
  30. <where>
  31. <if test="params.boy != null">
  32. <if test="params.boy.lineName != null and params.boy.lineName != ''">
  33. line_name like concat('%', #{params.boy.lineName}, '%')
  34. </if>
  35. <if test="params.boy.startTime != null">
  36. and create_time gl;
  37. #{params.boy.startTime}
  38. </if>
  39. <if test="params.boy.endTime != null">
  40. and create_time le;
  41. #{params.boy.endTime}
  42. </if>
  43. </if>
  44. </where>
  45. ORDER BY id
  46. OFFSET #{params.offset} ROWS
  47. FETCH NEXT #{params.size} ROWS ONLY
  48. </select>
  49. </mapper>