SysSmsTempMapper.xml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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="cn.tr.module.sys.sms.repository.SysSmsTempRepository">
  6. <resultMap id="stdResult" type="cn.tr.module.sys.sms.dto.SysSmsTempDTO">
  7. <result property="id" column="id"/>
  8. <result property="channelId" column="channel_id"/>
  9. <result property="channelName" column="channel_name"/>
  10. <result property="createType" column="create_type"/>
  11. <result property="tempType" column="temp_type"/>
  12. <result property="content" column="content"/>
  13. <result property="code" column="code"/>
  14. <result property="name" column="name"/>
  15. <result property="apiTempCode" column="api_temp_code"/>
  16. <result property="remark" column="remark"/>
  17. <result property="createTime" column="create_time"/>
  18. <result property="updateTime" column="update_time"/>
  19. </resultMap>
  20. <select id="stdSelectList" resultMap="stdResult">
  21. select st.id as id,
  22. st.channel_id as channel_id,
  23. st.create_type as create_type,
  24. st.temp_type as temp_type,
  25. st.content as content,
  26. st.code as code,
  27. st.name as name,
  28. st.api_temp_code as api_temp_code,
  29. st.remark as remark,
  30. st.create_time as create_time,
  31. st.update_time as update_time,
  32. sc.`name` as channel_name
  33. from sys_sms_temp as st LEFT JOIN sys_sms_channel as sc on st.channel_id = sc.id
  34. <where>
  35. <if test="query.channelId != null">
  36. and st.channel_id = #{query.channelId}
  37. </if>
  38. <if test="query.tempType != null">
  39. and st.temp_type = #{query.tempType}
  40. </if>
  41. <if test="query.code != null">
  42. and st.code like concat('%',#{query.tempType},'%')
  43. </if>
  44. </where>
  45. </select>
  46. <select id="stdSelectById" resultMap="stdResult">
  47. select st.id as id,
  48. st.channel_id as channel_id,
  49. st.create_type as create_type,
  50. st.temp_type as temp_type,
  51. st.content as content,
  52. st.code as code,
  53. st.name as name,
  54. st.api_temp_code as api_temp_code,
  55. st.remark as remark,
  56. st.create_time as create_time,
  57. st.update_time as update_time,
  58. sc.`name` as channel_name
  59. from sys_sms_temp as st LEFT JOIN sys_sms_channel as sc on st.channel_id = sc.id
  60. where st.id = #{tempId}
  61. </select>
  62. </mapper>