1
0

TemplateConfDao.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.manager.dao.TemplateConfDao">
  4. <resultMap type="com.kmall.manager.entity.pay.TemplateConfVo" id="templateConfMap">
  5. <result property="id" column="id"/>
  6. <result property="templateType" column="template_type"/>
  7. <result property="templateId" column="template_id"/>
  8. <result property="desc" column="desc"/>
  9. </resultMap>
  10. <select id="queryByTypeId" resultMap="templateConfMap">
  11. select
  12. `id`,
  13. `template_type`,
  14. `template_id`,
  15. `desc`
  16. from mall_template_conf
  17. where template_type = #{templateType}
  18. </select>
  19. <select id="queryList" resultMap="templateConfMap">
  20. select
  21. `id`,
  22. `template_type`,
  23. `template_id`,
  24. `desc`
  25. from mall_template_conf
  26. WHERE 1=1
  27. <if test="name != null and name.trim() != ''">
  28. AND name LIKE concat('%',#{name},'%')
  29. </if>
  30. <choose>
  31. <when test="sidx != null and sidx.trim() != ''">
  32. order by ${sidx} ${order}
  33. </when>
  34. <otherwise>
  35. order by id desc
  36. </otherwise>
  37. </choose>
  38. <if test="offset != null and limit != null">
  39. limit #{offset}, #{limit}
  40. </if>
  41. </select>
  42. <select id="queryTotal" resultType="int">
  43. select count(*) from mall_template_conf
  44. WHERE 1=1
  45. <if test="name != null and name.trim() != ''">
  46. AND name LIKE concat('%',#{name},'%')
  47. </if>
  48. </select>
  49. </mapper>