|
- <?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.WxLegionActivityConfigMapper">
-
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxLegionActivityConfig">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="tenantId" column="tenant_id" jdbcType="VARCHAR"/>
- <result property="parentTenantId" column="parent_tenant_id" jdbcType="VARCHAR"/>
- <result property="activityId" column="activity_id" jdbcType="BIGINT"/>
- <result property="parentId" column="parent_id" jdbcType="BIGINT"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
- <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
- </resultMap>
-
- <sql id="allColumns">
- id,tenant_id,parent_tenant_id,
- activity_id,parent_id,`name`,
- create_date,update_date
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != activityId ">
- and `activity_id` = #{activityId}
- </if>
- <if test=" null != parentId ">
- and `parent_id` = #{parentId}
- </if>
-
- <if test=" null != name and name != '' ">
- and `name` like concat('%', #{name},'%')
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxLegionActivityConfig" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_legion_activity_config
- <include refid="dynamicWhereConditions" />
- </select>
-
- <delete id="deleteConfig" parameterType="java.util.HashMap">
- delete from wx_legion_activity_config
- where `activity_id` = #{activityId}
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- </delete>
-
- <insert id="insertList" parameterType="java.util.List">
- insert into wx_legion_activity_config
- (id,
- activity_id,parent_id,`name`,
- create_date,update_date)
- values
- <foreach collection="configList" item="item" index="index" separator=",">
- (#{item.id,jdbcType=BIGINT},
- #{item.activityId,jdbcType=BIGINT},#{item.parentId,jdbcType=BIGINT},#{item.name,jdbcType=VARCHAR},
- #{item.createDate,jdbcType=TIMESTAMP},#{item.updateDate,jdbcType=TIMESTAMP})
- </foreach>
- </insert>
-
-
- <select id="findActivityCount" parameterType="com.iformall.domain.po.WxLegionActivityConfig" resultType="com.iformall.domain.vo.LegionActivityCount">
- select activity_id as 'activityId',
- count(1) as 'count'
- from wx_legion_activity_config
- where 1 = 1
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != activityId ">
- and `activity_id` = #{activityId}
- </if>
- <if test=" null != parentId ">
- and `parent_id` = #{parentId}
- </if>
- <if test=" null != activityIdList ">
- and `activity_id` in
- <foreach collection="activityIdList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- group by activity_id
- </select>
- </mapper>
|