1
0

ApiHelpIssueMapper.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.kmall.api.dao.ApiHelpIssueMapper">
  4. <resultMap type="com.kmall.api.entity.HelpIssueVo" id="helpIssueMap">
  5. <result property="id" column="id"/>
  6. <result property="typeId" column="type_id"/>
  7. <result property="question" column="question"/>
  8. <result property="answer" column="answer"/>
  9. <result property="sort" column="sort"/>
  10. </resultMap>
  11. <select id="queryObject" resultType="com.kmall.api.entity.HelpIssueVo">
  12. select
  13. `id`,
  14. `type_id`,
  15. `question`,
  16. `answer`,
  17. `sort`
  18. from mall_help_issue
  19. where id = #{id}
  20. </select>
  21. <select id="queryList" resultType="com.kmall.api.entity.HelpIssueVo">
  22. select
  23. `id`,
  24. `type_id`,
  25. `question`,
  26. `answer`,
  27. `sort`
  28. from mall_help_issue
  29. WHERE 1=1
  30. <if test="type_id != null and type_id != ''">
  31. AND type_id = #{type_id}
  32. </if>
  33. <if test="merchSn != null and merchSn != ''">
  34. AND merch_sn = #{merchSn}
  35. </if>
  36. <choose>
  37. <when test="sidx != null and sidx.trim() != ''">
  38. order by ${sidx} ${order}
  39. </when>
  40. <otherwise>
  41. order by sort asc
  42. </otherwise>
  43. </choose>
  44. <if test="offset != null and limit != null">
  45. limit #{offset}, #{limit}
  46. </if>
  47. </select>
  48. <select id="queryTotal" resultType="int">
  49. select count(*) from mall_help_issue
  50. WHERE 1=1
  51. <if test="name != null and name.trim() != ''">
  52. AND name LIKE concat('%',#{name},'%')
  53. </if>
  54. </select>
  55. </mapper>