Files
jsowell-charger-web/jsowell-pile/src/main/resources/mapper/pile/PileMerchantInfoMapper.xml

1305 lines
47 KiB
XML

<?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.jsowell.pile.mapper.PileMerchantInfoMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.PileMerchantInfo">
<!--@mbg.generated-->
<!--@Table pile_merchant_info-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="merchant_name" jdbcType="VARCHAR" property="merchantName" />
<result column="merchant_level" jdbcType="VARCHAR" property="merchantLevel" />
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="dept_id" jdbcType="VARCHAR" property="deptId" />
<result column="status" jdbcType="CHAR" property="status" />
<result column="delay_mode" jdbcType="VARCHAR" property="delayMode" />
<result column="organization_code" jdbcType="VARCHAR" property="organizationCode" />
<result column="manager_name" jdbcType="VARCHAR" property="managerName" />
<result column="manager_phone" jdbcType="VARCHAR" property="managerPhone" />
<result column="service_phone" jdbcType="VARCHAR" property="servicePhone" />
<result column="logo_url" jdbcType="VARCHAR" property="logoUrl" />
<result column="business_license_url" jdbcType="VARCHAR" property="businessLicenseUrl" />
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="alipay_app_id" jdbcType="VARCHAR" property="alipayAppId" />
<result column="withdrawal_type" jdbcType="VARCHAR" property="withdrawalType" />
<result column="reserved_amount" jdbcType="DECIMAL" property="reservedAmount" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="CHAR" property="delFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, merchant_name, merchant_level, parent_id, address, dept_id, `status`, delay_mode,
organization_code, manager_name, manager_phone, service_phone, logo_url, business_license_url, app_id,
alipay_app_id, withdrawal_type, reserved_amount, create_by, create_time, update_by,
update_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from pile_merchant_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from pile_merchant_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileMerchantInfo" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into pile_merchant_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="merchantName != null">
merchant_name,
</if>
<if test="merchantLevel != null">
merchant_level,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="address != null">
address,
</if>
<if test="deptId != null">
dept_id,
</if>
<if test="status != null">
`status`,
</if>
<if test="delayMode != null">
delay_mode,
</if>
<if test="organizationCode != null">
organization_code,
</if>
<if test="managerName != null">
manager_name,
</if>
<if test="managerPhone != null">
manager_phone,
</if>
<if test="servicePhone != null">
service_phone,
</if>
<if test="logoUrl != null">
logo_url,
</if>
<if test="businessLicenseUrl != null">
business_license_url,
</if>
<if test="appId != null">
app_id,
</if>
<if test="alipayAppId != null">
alipay_app_id,
</if>
<if test="withdrawalType != null">
withdrawal_type,
</if>
<if test="reservedAmount != null">
reserved_amount,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="merchantName != null">
#{merchantName,jdbcType=VARCHAR},
</if>
<if test="merchantLevel != null">
#{merchantLevel,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=VARCHAR},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="deptId != null">
#{deptId,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=CHAR},
</if>
<if test="delayMode != null">
#{delayMode,jdbcType=VARCHAR},
</if>
<if test="organizationCode != null">
#{organizationCode,jdbcType=VARCHAR},
</if>
<if test="managerName != null">
#{managerName,jdbcType=VARCHAR},
</if>
<if test="managerPhone != null">
#{managerPhone,jdbcType=VARCHAR},
</if>
<if test="servicePhone != null">
#{servicePhone,jdbcType=VARCHAR},
</if>
<if test="logoUrl != null">
#{logoUrl,jdbcType=VARCHAR},
</if>
<if test="businessLicenseUrl != null">
#{businessLicenseUrl,jdbcType=VARCHAR},
</if>
<if test="appId != null">
#{appId,jdbcType=VARCHAR},
</if>
<if test="alipayAppId != null">
#{alipayAppId,jdbcType=VARCHAR},
</if>
<if test="withdrawalType != null">
#{withdrawalType,jdbcType=VARCHAR},
</if>
<if test="reservedAmount != null">
#{reservedAmount,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=CHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.PileMerchantInfo">
<!--@mbg.generated-->
update pile_merchant_info
<set>
<if test="merchantName != null">
merchant_name = #{merchantName,jdbcType=VARCHAR},
</if>
<if test="merchantLevel != null">
merchant_level = #{merchantLevel,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=VARCHAR},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="deptId != null">
dept_id = #{deptId,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=CHAR},
</if>
<if test="delayMode != null">
delay_mode = #{delayMode,jdbcType=VARCHAR},
</if>
<if test="organizationCode != null">
organization_code = #{organizationCode,jdbcType=VARCHAR},
</if>
<if test="managerName != null">
manager_name = #{managerName,jdbcType=VARCHAR},
</if>
<if test="managerPhone != null">
manager_phone = #{managerPhone,jdbcType=VARCHAR},
</if>
<if test="servicePhone != null">
service_phone = #{servicePhone,jdbcType=VARCHAR},
</if>
<if test="logoUrl != null">
logo_url = #{logoUrl,jdbcType=VARCHAR},
</if>
<if test="businessLicenseUrl != null">
business_license_url = #{businessLicenseUrl,jdbcType=VARCHAR},
</if>
<if test="appId != null">
app_id = #{appId,jdbcType=VARCHAR},
</if>
<if test="alipayAppId != null">
alipay_app_id = #{alipayAppId,jdbcType=VARCHAR},
</if>
<if test="withdrawalType != null">
withdrawal_type = #{withdrawalType,jdbcType=VARCHAR},
</if>
<if test="reservedAmount != null">
reserved_amount = #{reservedAmount,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=CHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update pile_merchant_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="merchant_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="merchant_level = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantLevel,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="parent_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.parentId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.address,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="dept_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.deptId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=CHAR}
</foreach>
</trim>
<trim prefix="delay_mode = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.delayMode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="organization_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.organizationCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="manager_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.managerName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="manager_phone = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.managerPhone,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="service_phone = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.servicePhone,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="logo_url = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.logoUrl,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="business_license_url = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.businessLicenseUrl,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="app_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.appId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="alipay_app_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.alipayAppId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="withdrawal_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.withdrawalType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="reserved_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update pile_merchant_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="merchant_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.merchantName != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="merchant_level = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.merchantLevel != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantLevel,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="parent_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.parentId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.parentId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.address != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.address,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="dept_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.deptId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.deptId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=CHAR}
</if>
</foreach>
</trim>
<trim prefix="delay_mode = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.delayMode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.delayMode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="organization_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.organizationCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.organizationCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="manager_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.managerName != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.managerName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="manager_phone = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.managerPhone != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.managerPhone,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="service_phone = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.servicePhone != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.servicePhone,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="logo_url = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.logoUrl != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.logoUrl,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="business_license_url = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.businessLicenseUrl != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.businessLicenseUrl,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="app_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.appId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.appId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="alipay_app_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.alipayAppId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.alipayAppId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="withdrawal_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.withdrawalType != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.withdrawalType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="reserved_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.reservedAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.delFlag != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into pile_merchant_info
(merchant_name, merchant_level, parent_id, address, dept_id, `status`, delay_mode,
organization_code, manager_name, manager_phone, service_phone, logo_url, business_license_url, app_id,
alipay_app_id, withdrawal_type, reserved_amount, create_by, create_time, update_by,
update_time, del_flag)
values
<foreach collection="list" item="item" separator=",">
(#{item.merchantName,jdbcType=VARCHAR}, #{item.merchantLevel,jdbcType=VARCHAR}, #{item.parentId,jdbcType=VARCHAR},
#{item.address,jdbcType=VARCHAR}, #{item.deptId,jdbcType=VARCHAR}, #{item.status,jdbcType=CHAR},
#{item.delayMode,jdbcType=VARCHAR}, #{item.organizationCode,jdbcType=VARCHAR},
#{item.managerName,jdbcType=VARCHAR}, #{item.managerPhone,jdbcType=VARCHAR}, #{item.servicePhone,jdbcType=VARCHAR},
#{item.logoUrl,jdbcType=VARCHAR}, #{item.businessLicenseUrl,jdbcType=VARCHAR}, #{item.appId,jdbcType=VARCHAR}, #{item.alipayAppId,jdbcType=VARCHAR},
#{item.withdrawalType,jdbcType=VARCHAR}, #{item.reservedAmount,jdbcType=DECIMAL},
#{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR},
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=CHAR})
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileMerchantInfo" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into pile_merchant_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
merchant_name,
merchant_level,
parent_id,
address,
dept_id,
`status`,
delay_mode,
organization_code,
manager_name,
manager_phone,
service_phone,
logo_url,
business_license_url,
app_id,
alipay_app_id,
withdrawal_type,
reserved_amount,
create_by,
create_time,
update_by,
update_time,
del_flag,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{merchantName,jdbcType=VARCHAR},
#{merchantLevel,jdbcType=VARCHAR},
#{parentId,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR},
#{deptId,jdbcType=VARCHAR},
#{status,jdbcType=CHAR},
#{delayMode,jdbcType=VARCHAR},
#{organizationCode,jdbcType=VARCHAR},
#{managerName,jdbcType=VARCHAR},
#{managerPhone,jdbcType=VARCHAR},
#{servicePhone,jdbcType=VARCHAR},
#{logoUrl,jdbcType=VARCHAR},
#{businessLicenseUrl,jdbcType=VARCHAR},
#{appId,jdbcType=VARCHAR},
#{alipayAppId,jdbcType=VARCHAR},
#{withdrawalType,jdbcType=VARCHAR},
#{reservedAmount,jdbcType=DECIMAL},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=CHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
merchant_name = #{merchantName,jdbcType=VARCHAR},
merchant_level = #{merchantLevel,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
dept_id = #{deptId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=CHAR},
delay_mode = #{delayMode,jdbcType=VARCHAR},
organization_code = #{organizationCode,jdbcType=VARCHAR},
manager_name = #{managerName,jdbcType=VARCHAR},
manager_phone = #{managerPhone,jdbcType=VARCHAR},
service_phone = #{servicePhone,jdbcType=VARCHAR},
logo_url = #{logoUrl,jdbcType=VARCHAR},
business_license_url = #{businessLicenseUrl,jdbcType=VARCHAR},
app_id = #{appId,jdbcType=VARCHAR},
alipay_app_id = #{alipayAppId,jdbcType=VARCHAR},
withdrawal_type = #{withdrawalType,jdbcType=VARCHAR},
reserved_amount = #{reservedAmount,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=CHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileMerchantInfo" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into pile_merchant_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="merchantName != null">
merchant_name,
</if>
<if test="merchantLevel != null">
merchant_level,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="address != null">
address,
</if>
<if test="deptId != null">
dept_id,
</if>
<if test="status != null">
`status`,
</if>
<if test="delayMode != null">
delay_mode,
</if>
<if test="organizationCode != null">
organization_code,
</if>
<if test="managerName != null">
manager_name,
</if>
<if test="managerPhone != null">
manager_phone,
</if>
<if test="servicePhone != null">
service_phone,
</if>
<if test="logoUrl != null">
logo_url,
</if>
<if test="businessLicenseUrl != null">
business_license_url,
</if>
<if test="appId != null">
app_id,
</if>
<if test="alipayAppId != null">
alipay_app_id,
</if>
<if test="withdrawalType != null">
withdrawal_type,
</if>
<if test="reservedAmount != null">
reserved_amount,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="merchantName != null">
#{merchantName,jdbcType=VARCHAR},
</if>
<if test="merchantLevel != null">
#{merchantLevel,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=VARCHAR},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="deptId != null">
#{deptId,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=CHAR},
</if>
<if test="delayMode != null">
#{delayMode,jdbcType=VARCHAR},
</if>
<if test="organizationCode != null">
#{organizationCode,jdbcType=VARCHAR},
</if>
<if test="managerName != null">
#{managerName,jdbcType=VARCHAR},
</if>
<if test="managerPhone != null">
#{managerPhone,jdbcType=VARCHAR},
</if>
<if test="servicePhone != null">
#{servicePhone,jdbcType=VARCHAR},
</if>
<if test="logoUrl != null">
#{logoUrl,jdbcType=VARCHAR},
</if>
<if test="businessLicenseUrl != null">
#{businessLicenseUrl,jdbcType=VARCHAR},
</if>
<if test="appId != null">
#{appId,jdbcType=VARCHAR},
</if>
<if test="alipayAppId != null">
#{alipayAppId,jdbcType=VARCHAR},
</if>
<if test="withdrawalType != null">
#{withdrawalType,jdbcType=VARCHAR},
</if>
<if test="reservedAmount != null">
#{reservedAmount,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=CHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="merchantName != null">
merchant_name = #{merchantName,jdbcType=VARCHAR},
</if>
<if test="merchantLevel != null">
merchant_level = #{merchantLevel,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=VARCHAR},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="deptId != null">
dept_id = #{deptId,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=CHAR},
</if>
<if test="delayMode != null">
delay_mode = #{delayMode,jdbcType=VARCHAR},
</if>
<if test="organizationCode != null">
organization_code = #{organizationCode,jdbcType=VARCHAR},
</if>
<if test="managerName != null">
manager_name = #{managerName,jdbcType=VARCHAR},
</if>
<if test="managerPhone != null">
manager_phone = #{managerPhone,jdbcType=VARCHAR},
</if>
<if test="servicePhone != null">
service_phone = #{servicePhone,jdbcType=VARCHAR},
</if>
<if test="logoUrl != null">
logo_url = #{logoUrl,jdbcType=VARCHAR},
</if>
<if test="businessLicenseUrl != null">
business_license_url = #{businessLicenseUrl,jdbcType=VARCHAR},
</if>
<if test="appId != null">
app_id = #{appId,jdbcType=VARCHAR},
</if>
<if test="alipayAppId != null">
alipay_app_id = #{alipayAppId,jdbcType=VARCHAR},
</if>
<if test="withdrawalType != null">
withdrawal_type = #{withdrawalType,jdbcType=VARCHAR},
</if>
<if test="reservedAmount != null">
reserved_amount = #{reservedAmount,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=CHAR},
</if>
</trim>
</insert>
<sql id="selectPileMerchantInfoVo">
select
<include refid="Base_Column_List" />
from pile_merchant_info
</sql>
<select id="selectPileMerchantInfoList" parameterType="com.jsowell.pile.domain.PileMerchantInfo" resultMap="BaseResultMap">
<include refid="selectPileMerchantInfoVo" />
<where>
del_flag = '0'
<if test="merchantName != null and merchantName != ''">
and merchant_name like concat('%', #{merchantName}, '%')
</if>
<if test="address != null and address != ''">
and address = #{address}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="delayMode != null and delayMode != ''">
and delay_mode = #{delayMode}
</if>
<if test="organizationCode != null and organizationCode != ''">
and organization_code = #{organizationCode}
</if>
<if test="managerName != null and managerName != ''">
and manager_name like concat('%', #{managerName}, '%')
</if>
<if test="managerPhone != null and managerPhone != ''">
and manager_phone = #{managerPhone}
</if>
<if test="servicePhone != null and servicePhone != ''">
and service_phone = #{servicePhone}
</if>
<if test="logoUrl != null and logoUrl != ''">
and logo_url = #{logoUrl}
</if>
<if test="businessLicenseUrl != null and businessLicenseUrl != ''">
and business_license_url = #{businessLicenseUrl}
</if>
<!-- 数据范围过滤 -->
<if test="merchantDeptIds != null and merchantDeptIds.size() != 0">
and dept_id in
<foreach close=")" collection="merchantDeptIds" item="merchantDeptId" open="(" separator=",">
#{merchantDeptId}
</foreach>
</if>
</where>
</select>
<select id="selectPileMerchantInfoById" parameterType="Long" resultMap="BaseResultMap">
<include refid="selectPileMerchantInfoVo" />
where id = #{id}
</select>
<select id="selectPileMerchantInfoListByIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pile_merchant_info
where id in
<foreach close=")" collection="merchantIdList" item="merchantId" open="(" separator=",">
#{merchantId,jdbcType=VARCHAR}
</foreach>
</select>
<insert id="insertPileMerchantInfo" parameterType="com.jsowell.pile.domain.PileMerchantInfo">
insert into pile_merchant_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="merchantName != null">
merchant_name,
</if>
<if test="merchantLevel != null">
merchant_level,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="address != null">
address,
</if>
<if test="status != null">
status,
</if>
<if test="delayMode != null">
delay_mode,
</if>
<if test="organizationCode != null">
organization_code,
</if>
<if test="managerName != null">
manager_name,
</if>
<if test="managerPhone != null">
manager_phone,
</if>
<if test="servicePhone != null">
service_phone,
</if>
<if test="logoUrl != null">
logo_url,
</if>
<if test="businessLicenseUrl != null">
business_license_url,
</if>
<if test="appId != null">
app_id,
</if>
<if test="alipayAppId != null">
alipay_app_id,
</if>
<if test="deptId != null">
dept_id,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="merchantName != null">
#{merchantName},
</if>
<if test="merchantLevel != null">
#{merchantLevel},
</if>
<if test="parentId != null">
#{parentId},
</if>
<if test="address != null">
#{address},
</if>
<if test="status != null">
#{status},
</if>
<if test="delayMode != null">
#{delayMode},
</if>
<if test="organizationCode != null">
#{organizationCode},
</if>
<if test="managerName != null">
#{managerName},
</if>
<if test="managerPhone != null">
#{managerPhone},
</if>
<if test="servicePhone != null">
#{servicePhone},
</if>
<if test="logoUrl != null">
#{logoUrl},
</if>
<if test="businessLicenseUrl != null">
#{businessLicenseUrl},
</if>
<if test="appId != null">
#{appId},
</if>
<if test="alipayAppId != null">
#{alipayAppId},
</if>
<if test="deptId != null">
#{deptId},
</if>
<if test="createBy != null">
#{createBy},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateBy != null">
#{updateBy},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="delFlag != null">
#{delFlag},
</if>
</trim>
</insert>
<update id="updatePileMerchantInfo" parameterType="com.jsowell.pile.domain.PileMerchantInfo">
update pile_merchant_info
<trim prefix="SET" suffixOverrides=",">
<if test="merchantName != null">
merchant_name = #{merchantName},
</if>
<if test="merchantLevel != null">
merchant_level = #{merchantLevel},
</if>
<if test="parentId != null">
parent_id = #{parentId},
</if>
<if test="address != null">
address = #{address},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="delayMode != null">
delay_mode = #{delayMode},
</if>
<if test="organizationCode != null">
organization_code = #{organizationCode},
</if>
<if test="managerName != null">
manager_name = #{managerName},
</if>
<if test="managerPhone != null">
manager_phone = #{managerPhone},
</if>
<if test="servicePhone != null">
service_phone = #{servicePhone},
</if>
<if test="logoUrl != null">
logo_url = #{logoUrl},
</if>
<if test="businessLicenseUrl != null">
business_license_url = #{businessLicenseUrl},
</if>
<if test="appId != null">
app_id = #{appId},
</if>
<if test="alipayAppId != null">
alipay_app_id = #{alipayAppId},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileMerchantInfoById" parameterType="Long">
update pile_merchant_info
set del_flag = '1'
where id = #{id}
</delete>
<delete id="deletePileMerchantInfoByIds" parameterType="String">
update pile_merchant_info
set del_flag = '1'
where id in
<foreach close=")" collection="array" item="id" open="(" separator=",">
#{id}
</foreach>
</delete>
<select id="selectPileMerchantInfoByWxAppId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pile_merchant_info
where
app_id = #{appId,jdbcType=VARCHAR}
</select>
<select id="queryByMerchantDeptIds" resultType="java.lang.String">
SELECT
t2.id
FROM
pile_merchant_info t1
LEFT JOIN pile_station_info t2 ON t2.merchant_id = t1.id and t2.del_flag = '0'
WHERE
t1.del_flag = '0'
<if test="merchantDeptIds != null and merchantDeptIds.size() != 0">
AND t1.dept_id IN
<foreach close=")" collection="merchantDeptIds" item="item" open="(" separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<select id="queryInfoByDeptId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pile_merchant_info
where del_flag = '0'
and dept_id = #{deptId,jdbcType=VARCHAR}
</select>
<select id="queryInfoListByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from
pile_merchant_info
where del_flag = '0'
<if test="deptIds != null and deptIds.size() != 0">
and dept_id in
<foreach close=")" collection="deptIds" item="deptId" open="(" separator=",">
#{deptId,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<select id="queryFirstLevelMerchantList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from
pile_merchant_info
where del_flag = '0'
and merchant_level = '1'
</select>
<select id="getFirstLevelMerchantByWxAppId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from
pile_merchant_info
where del_flag = '0'
and merchant_level = '1'
and app_id = #{wxAppId,jdbcType=VARCHAR}
</select>
<select id="getFirstLevelMerchantByAlipayAppId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from
pile_merchant_info
where del_flag = '0'
and merchant_level = '1'
and alipay_app_id = #{alipayAppId,jdbcType=VARCHAR}
</select>
<select id="getDeptIdsByWxAppId" resultType="java.lang.String">
select
dept_id as deptId
from
pile_merchant_info
where del_flag = '0'
<if test="appId != null and appId != ''">
and (app_id = #{appId,jdbcType=VARCHAR} or alipay_app_id = #{appId,jdbcType=VARCHAR})
</if>
</select>
<select id="queryMerchantSettleInfoList" resultType="com.jsowell.pile.vo.web.MerchantSettleInfoVO">
SELECT
t1.id as merchantId,
t1.merchant_name AS merchantName,
t1.address,
t1.status,
t2.adapay_member_id AS adapayMemberId,
t2.settle_account_id AS settleAccountId,
t2.`status` as auditStatus,
t1.organization_code AS organizationCode,
t1.manager_name AS managerName,
t1.manager_phone AS managerPhone,
t1.create_time AS createTime
FROM
pile_merchant_info t1
left JOIN adapay_member_account t2 ON t1.id = t2.merchant_id AND t2.del_flag = '0'
where t1.del_flag = '0'
<if test="dto.deptIds != null and dto.deptIds.size() != 0">
and t1.dept_id in
<foreach close=")" collection="dto.deptIds" item="deptId" open="(" separator=",">
#{deptId,jdbcType=VARCHAR}
</foreach>
</if>
<if test="dto.merchantName != null and dto.merchantName != ''">
and t1.merchant_name like #{dto.merchantName,jdbcType=VARCHAR}
</if>
<if test="dto.merchantId != null and dto.merchantId != ''">
and t1.id = #{dto.merchantId,jdbcType=VARCHAR}
</if>
<if test="dto.managerName != null and dto.managerName != ''">
and t1.manager_name = #{dto.managerName,jdbcType=VARCHAR}
</if>
<if test="dto.managerPhone != null and dto.managerPhone != ''">
and t1.manager_phone = #{dto.managerPhone,jdbcType=VARCHAR}
</if>
</select>
<select id="selectListByFirstMerchant" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from pile_merchant_info
where del_flag = '0'
and (parent_id = #{firstMerchantId,jdbcType=VARCHAR} or id = #{firstMerchantId,jdbcType=VARCHAR})
</select>
<select id="queryMerchantInfoByStationId" resultType="com.jsowell.pile.vo.web.PileMerchantInfoVO">
SELECT
t1.id AS stationId,
t1.merchant_id AS merchantId,
t2.merchant_name AS merchantName,
t2.organization_code AS organizationCode
FROM
pile_station_info t1
JOIN pile_merchant_info t2 ON t1.merchant_id = t2.id
WHERE
t1.del_flag = '0'
AND t1.id = #{stationId,jdbcType=VARCHAR}
</select>
<select id="selectAutoWithdrawalMerchantInfoList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from
pile_merchant_info
where del_flag = '0'
and status = '1'
and withdrawal_type = '2'
</select>
</mapper>