OneIdMappingMapper.xml 2.42 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.cdp.modules.mapper.OneIdMappingMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.cdp.modules.entity.OneIdMapping">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="org_id" jdbcType="VARCHAR" property="orgId" />
    <result column="business_type" jdbcType="TINYINT" property="businessType" />
    <result column="field_name" jdbcType="VARCHAR" property="fieldName" />
    <result column="field_value" jdbcType="VARCHAR" property="fieldValue" />
    <result column="one_id" jdbcType="VARCHAR" property="oneId" />
    <result column="created_by" jdbcType="VARCHAR" property="createdBy" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
    <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
    <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    id, org_id, business_type, field_name, field_value, one_id, created_by, created_time, 
    updated_by, updated_time, del_flag
  </sql>
    <select id="list" resultType="cn.com.glsx.cdp.modules.model.OneIdMappingDTO">
      select
        <include refid="Base_Column_List" />
          from cdp_oneid_mapping
      <where>
        del_flag = 0
        <if test="orgId != null">
            and org_id = #{orgId}
        </if>
        <if test="businessType != null">
            and business_type = #{businessType}
        </if>
          <if test="fieldName != null">
              and field_name = #{fieldName}
          </if>
          <if test="oneId != null">
              and one_id = #{oneId}
          </if>
        <if test="fieldNames != null and fieldNames.size()>0">
            and field_name in
            <foreach collection="fieldNames" item="item" open="(" separator="," close=")">
              #{item}
            </foreach>
        </if>
        <if test="oneIds != null and oneIds.size()>0">
            and one_id in
            <foreach collection="oneIds" item="item" open="(" separator="," close=")">
              #{item}
            </foreach>
        </if>
      </where>
    </select>
</mapper>