|
- <?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="mould_type" property="mouldType" />
-
- <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`,`type`,`mould_type`,`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` = 1 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>
- <if test=" null != mouldType">
- and `mould_type` = #{mouldType}
- </if>
- order by id 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="findDefaultList" resultType="com.iformall.domain.po.WxMiniappThemeValue">
- SELECT `name`, remarks,default_icon icon,default_style styleClass
- FROM wx_miniapp_theme_deploy
- where theme_type = #{themeType} and mould_type = #{mouldType};
- </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 and mtv.miniapp_theme_id = #{themeId}
- left join wx_miniapp_theme mt on mt.id = mtv.miniapp_theme_id
- where mt.del_status = 0
- </select>
-
-
- </mapper>
|