|
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.WxMiniappThemeMapper">
-
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMiniappTheme">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="tenant_id" property="tenantId" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="remarks" property="remarks" />
- <result column="preview_url" property="previewUrl" />
- <result column="type" property="type" />
- <result column="create_date" property="createDate" />
- <result column="update_date" property="updateDate" />
-
- <!--<collection fetchType="eager" property="wxMiniappThemeValue" ofType="com.iformall.domain.po.WxMiniappThemeValue" column="id" select="findChildList"/>-->
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`name`,`remarks`,`preview_url`,`status`,`create_date`,`update_date`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where del_status = 0
- <if test=" null != id "> and `id` = #{id} </if>
- <if test=" null != tenantId and '' != tenantId">
- and (`tenant_id` = 0 or`tenant_id` = #{tenantId})
- </if>
- <if test=" null != name and '' != name "> and `name` like concat('%', #{name},'%') </if>
- <if test=" null != type">
- and `type` = #{type}
- </if>
- order by create_date asc
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxMiniappTheme" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_miniapp_theme
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findChildList" resultType="com.iformall.domain.po.WxMiniappThemeValue">
- SELECT mtv.id id,mtv.miniapp_theme_id miniappThemeId,mtv.miniapp_deploy_id miniappDeployId,
- mtd.name name,mtd.remarks remarks,ifnull(mtv.icon,mtd.default_icon) icon,ifnull(mtv.style_class,mtd.default_style) styleClass
- FROM wx_miniapp_theme_deploy mtd
- left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id and mtv.miniapp_theme_id = #{id};
- </select>
-
- <update id="updateDel" parameterType="com.iformall.domain.po.WxMiniappTheme">
- update wx_miniapp_theme set `del_status` = 1, update_date = now() where id = #{id};
- </update>
-
-
- <select id="findDeployList" parameterType="Integer" resultType="com.iformall.domain.po.WxMiniappThemeDeploy">
- SELECT id,`name`,remarks,theme_type themeType,default_icon defaultIcon,default_style defaultStyle
- FROM wx_miniapp_theme_deploy where theme_type = #{themeType};
- </select>
-
-
- <delete id="deleteValue" parameterType="com.iformall.domain.po.WxMiniappTheme">
- delete from wx_miniapp_theme_value where miniapp_theme_id = #{id};
- </delete>
-
- <insert id="insertValue" parameterType="com.iformall.domain.po.WxMiniappThemeValue">
- INSERT INTO wx_miniapp_theme_value (id,miniapp_theme_id,miniapp_deploy_id,icon,style_class)
- VALUES (#{id},#{miniappThemeId},#{miniappDeployId},#{icon},#{styleClass});
- </insert>
-
-
- <select id="finThemeByThemeMall" parameterType="com.iformall.domain.po.WxThemeMall" resultType="com.iformall.domain.po.WxMiniappThemeValue">
- SELECT mtv.id id,mtv.miniapp_theme_id miniappThemeId,mtv.miniapp_deploy_id miniappDeployId,
- mtd.name name,mtd.remarks remarks,ifnull(mtv.icon,mtd.default_icon) icon,ifnull(mtv.style_class,mtd.default_style) styleClass
- FROM wx_miniapp_theme_deploy mtd
- left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id
- left join wx_theme_mall tm on tm.theme_id = mtv.miniapp_theme_id and tm.theme_type = mtd.theme_type
- where mtd.theme_type = #{themeType} and tm.tenant_id = #{tenantId}
- </select>
-
-
- </mapper>
|