后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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