GroupOneTemplateMapper.xml 3.22 KB
<?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="cn.com.glsx.entmicro.mapper.GroupOneTemplateMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.GroupOneTemplate">
    <!--@Table scrm_group_one_template-->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="org_name" jdbcType="VARCHAR" property="orgName" />
    <result column="group_name" jdbcType="VARCHAR" property="groupName" />
    <result column="group_name_rule" jdbcType="INTEGER" property="groupNameRule" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="merchant_id" jdbcType="INTEGER" property="merchantId" />
    <result column="uuid" jdbcType="VARCHAR" property="uuid" />
    <result column="created_by" jdbcType="INTEGER" property="createdBy" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="updated_by" jdbcType="INTEGER" property="updatedBy" />
    <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
  </resultMap>
  <resultMap id="ResultMap" type="cn.com.glsx.entmicro.model.response.GroupOneTemplateResponse"
        extends="BaseResultMap">
  </resultMap>
  <sql id="Base_Column_List">
    id, org_name, group_name,group_name_rule, `status`, merchant_id, uuid, created_by, created_time, updated_by,
    updated_time, del_flag
  </sql>

  <!--<update id="updateByPrimaryKey" parameterType="cn.com.glsx.entmicro.entity.GroupOneTemplate">
    update scrm_group_one_template
    set org_name = #{orgName,jdbcType=VARCHAR},
      group_name = #{groupName,jdbcType=VARCHAR},
      welcome = #{welcome,jdbcType=VARCHAR},
      `status` = #{status,jdbcType=TINYINT},
      created_by = #{createdBy,jdbcType=INTEGER},
      created_time = #{createdTime,jdbcType=TIMESTAMP},
      updated_by = #{updatedBy,jdbcType=INTEGER},
      updated_time = #{updatedTime,jdbcType=TIMESTAMP},
      del_flag = #{delFlag,jdbcType=TINYINT}
    where id = #{id,jdbcType=INTEGER}
  </update>-->

  <select id="selectByCondition" resultMap="ResultMap" parameterType="cn.com.glsx.entmicro.model.request.GroupOneTemplateSearchRequest">
    select <include refid="Base_Column_List" /> from scrm_group_one_template
    where 1 = 1
      and merchant_id=#{obj.merchantId,jdbcType=VARCHAR}
    <if test="obj.groupName != null and obj.groupName != ''">
        and group_name like CONCAT('%',#{obj.groupName,jdbcType=VARCHAR},'%')
    </if>
    <if test="obj.status != null and obj.status != ''">
      and status=#{obj.status,jdbcType=TINYINT}
    </if>
    order by created_time desc
  </select>

  <select id="getOneTemplateListByName" resultMap="ResultMap" parameterType="cn.com.glsx.entmicro.model.request.GroupOneTemplateSearchRequest">
    select <include refid="Base_Column_List" /> from scrm_group_one_template
    where merchant_id=#{nameValid.merchantId,jdbcType=VARCHAR}
    <if test="nameValid.templateName!=null and nameValid.templateName!=''">
      and group_name=#{nameValid.templateName, jdbcType=VARCHAR}
    </if>
    and del_flag = 0
    order by created_time desc
  </select>

</mapper>