ApiHelpIssueMapper.xml 2.1 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.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. <if test="storeId != null and storeId != ''">
  37. AND store_id = #{storeId}
  38. </if>
  39. <choose>
  40. <when test="sidx != null and sidx.trim() != ''">
  41. order by ${sidx} ${order}
  42. </when>
  43. <otherwise>
  44. order by sort asc
  45. </otherwise>
  46. </choose>
  47. <if test="offset != null and limit != null">
  48. limit #{offset}, #{limit}
  49. </if>
  50. </select>
  51. <select id="queryTotal" resultType="int">
  52. select count(*) from mall_help_issue
  53. WHERE 1=1
  54. <if test="name != null and name.trim() != ''">
  55. AND name LIKE concat('%',#{name},'%')
  56. </if>
  57. <if test="merchSn != null and merchSn != ''">
  58. AND merch_sn = #{merchSn}
  59. </if>
  60. <if test="storeId != null and storeId != ''">
  61. AND store_id = #{storeId}
  62. </if>
  63. </select>
  64. </mapper>