|
- <?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.WxPressBatchMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPressBatch">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="status" jdbcType="INTEGER" property="status"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- <result column="promoter_limit_rule" jdbcType="INTEGER" property="promoterLimitRule"/>
- <result column="promoter_allow_count" jdbcType="INTEGER" property="promoterAllowCount"/>
- <result column="bargainer_allow_same" jdbcType="INTEGER" property="bargainerAllowSame"/>
- <result column="bargainer_allow_count" jdbcType="INTEGER" property="bargainerAllowCount"/>
- </resultMap>
-
-
- <sql id="allColumns">
- `id`, `tenant_id`, `parent_tenant_id`, `name`, `status`, `create_date`,`update_date`,`promoter_limit_rule`,`promoter_allow_count`, `bargainer_allow_same`, `bargainer_allow_count`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where `tenant_id` = #{tenantId}
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != status">
- and `status` = #{status}
- </if>
-
- <if test=" null != name and '' != name">
- and `name` like concat('%', #{name},'%')
- </if>
-
- <if test=" null != promoterLimitRule">
- and `promoter_limit_rule` = #{promoterLimitRule}
- </if>
-
- <if test=" null != bargainerAllowSame">
- and `bargainer_allow_same` = #{bargainerAllowSame}
- </if>
-
- <if test=" null != ids ">
- and `id` in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
-
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxPressBatch" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_press_batch
- <include refid="dynamicWhereConditions"/>
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </select>
-
- <select id="getById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select <include refid="allColumns"/> from wx_press_batch where `id` = #{id} and tenant_id=#{tenantId}
- </select>
-
- <update id="updateWxPressBatchStatus" parameterType="com.iformall.domain.po.WxPressBatch" >
- update wx_press_batch set status = #{status} where `id` = #{id} and tenant_id=#{tenantId}
- </update>
-
- <delete id="deleteById" parameterType="java.util.HashMap" >
- delete from wx_press_batch where `id` = #{id} and tenant_id=#{tenantId}
- </delete>
- </mapper>
|