WelcomeAccountMapper.xml 993 B

123456789101112131415161718192021222324252627282930
  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.template.mapper.WelcomeAccountMapper">
  4. <select id="listAccount" resultType="com.template.model.vo.WelcomeAccountVo">
  5. SELECT
  6. wa.*
  7. FROM
  8. `welcome_account` wa
  9. LEFT JOIN welcome_role wr ON wr.id = wa.role_id
  10. AND wr.deleted = 0
  11. WHERE
  12. wa.deleted = 0
  13. <if test="status != null and status != ''">
  14. and wa.status = #{status}
  15. </if>
  16. <if test="keyWord != null and keyWord != ''">
  17. and wa.name like '%' #{keyWord} '%'
  18. </if>
  19. <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
  20. and wa.create_time >= #{startTime} and #{endTime} >= wa.create_time
  21. </if>
  22. ORDER BY
  23. wa.create_time
  24. </select>
  25. </mapper>