Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

81 lignes
3.6 KiB

  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.iformall.mapper.WxMiniappThemeMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMiniappTheme">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" property="tenantId" />
  7. <result column="name" jdbcType="VARCHAR" property="name" />
  8. <result column="remarks" property="remarks" />
  9. <result column="preview_url" property="previewUrl" />
  10. <result column="type" property="type" />
  11. <result column="create_date" property="createDate" />
  12. <result column="update_date" property="updateDate" />
  13. <!--<collection fetchType="eager" property="wxMiniappThemeValue" ofType="com.iformall.domain.po.WxMiniappThemeValue" column="id" select="findChildList"/>-->
  14. </resultMap>
  15. <sql id="allColumns">
  16. `id`,`tenant_id`,`name`,`remarks`,`preview_url`,`status`,`create_date`,`update_date`
  17. </sql>
  18. <sql id="dynamicWhereConditions">
  19. where del_status = 0
  20. <if test=" null != id "> and `id` = #{id} </if>
  21. <if test=" null != tenantId and '' != tenantId">
  22. and (`tenant_id` = 0 or`tenant_id` = #{tenantId})
  23. </if>
  24. <if test=" null != name and '' != name "> and `name` like concat('%', #{name},'%') </if>
  25. <if test=" null != type">
  26. and `type` = #{type}
  27. </if>
  28. order by create_date asc
  29. </sql>
  30. <select id="findList" parameterType="com.iformall.domain.po.WxMiniappTheme" resultMap="BaseResultMap">
  31. select
  32. <include refid="allColumns"/>
  33. from wx_miniapp_theme
  34. <include refid="dynamicWhereConditions"/>
  35. </select>
  36. <select id="findChildList" resultType="com.iformall.domain.po.WxMiniappThemeValue">
  37. SELECT mtv.id id,mtv.miniapp_theme_id miniappThemeId,mtv.miniapp_deploy_id miniappDeployId,
  38. mtd.name name,mtd.remarks remarks,ifnull(mtv.icon,mtd.default_icon) icon,ifnull(mtv.style_class,mtd.default_style) styleClass
  39. FROM wx_miniapp_theme_deploy mtd
  40. left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id and mtv.miniapp_theme_id = #{id};
  41. </select>
  42. <update id="updateDel" parameterType="com.iformall.domain.po.WxMiniappTheme">
  43. update wx_miniapp_theme set `del_status` = 1, update_date = now() where id = #{id};
  44. </update>
  45. <select id="findDeployList" parameterType="Integer" resultType="com.iformall.domain.po.WxMiniappThemeDeploy">
  46. SELECT id,`name`,remarks,theme_type themeType,default_icon defaultIcon,default_style defaultStyle
  47. FROM wx_miniapp_theme_deploy where theme_type = #{themeType};
  48. </select>
  49. <delete id="deleteValue" parameterType="com.iformall.domain.po.WxMiniappTheme">
  50. delete from wx_miniapp_theme_value where miniapp_theme_id = #{id};
  51. </delete>
  52. <insert id="insertValue" parameterType="com.iformall.domain.po.WxMiniappThemeValue">
  53. INSERT INTO wx_miniapp_theme_value (id,miniapp_theme_id,miniapp_deploy_id,icon,style_class)
  54. VALUES (#{id},#{miniappThemeId},#{miniappDeployId},#{icon},#{styleClass});
  55. </insert>
  56. <select id="finThemeByThemeMall" parameterType="com.iformall.domain.po.WxThemeMall" resultType="com.iformall.domain.po.WxMiniappThemeValue">
  57. SELECT mtv.id id,mtv.miniapp_theme_id miniappThemeId,mtv.miniapp_deploy_id miniappDeployId,
  58. mtd.name name,mtd.remarks remarks,ifnull(mtv.icon,mtd.default_icon) icon,ifnull(mtv.style_class,mtd.default_style) styleClass
  59. FROM wx_miniapp_theme_deploy mtd
  60. left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id
  61. left join wx_theme_mall tm on tm.theme_id = mtv.miniapp_theme_id and tm.theme_type = mtd.theme_type
  62. where mtd.theme_type = #{themeType} and tm.tenant_id = #{tenantId}
  63. </select>
  64. </mapper>