2021-07-26 18:02:59 +08:00

294 lines
13 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.xhpc.user.mapper.XhpcInternetUserMapper">
<resultMap type="com.xhpc.user.domain.XhpcInternetUser" id="XhpcInternetUserResult">
<result column="internet_user_id" property="internetUserId"/>
<result column="name" property="name"/>
<result column="phone" property="phone"/>
<result column="contact_name" property="contactName"/>
<result column="contact_phone" property="contactPhone"/>
<result column="open_bank" property="openBank"/>
<result column="card_number" property="cardNumber"/>
<result column="cooperation_start_time" property="cooperationStartTime" jdbcType="TIMESTAMP"/>
<result column="cooperation_end_time" property="cooperationEndTime" jdbcType="TIMESTAMP"/>
<result column="money" property="money"/>
<result column="area_code" property="areaCode"/>
<result column="address" property="address"/>
<result column="detailed_address" property="detailedAddress"/>
<result column="commission_type" property="commissionType"/>
<result column="commission_rate" property="commissionRate"/>
<result column="longitude" property="longitude"/>
<result column="latitude" property="latitude"/>
<result column="status" property="status"/>
<result column="del_flag" property="delFlag"/>
<result column="create_by" property="createBy"/>
<result column="create_time" property="createTime"/>
<result column="update_by" property="updateBy"/>
<result column="update_time" property="updateTime"/>
<result column="remark" property="remark"/>
</resultMap>
<insert id="insert" parameterType="com.xhpc.user.domain.XhpcInternetUser" useGeneratedKeys="true"
keyProperty="XhpcInternetUserId">
INSERT INTO xhpc_internet_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != name and '' != name">
name,
</if>
<if test="null != phone and '' != phone">
phone,
</if>
<if test="null != contactName and '' != contactName">
contact_name,
</if>
<if test="null != contactPhone and '' != contactPhone">
contact_phone,
</if>
<if test="null != openBank and '' != openBank">
open_bank,
</if>
<if test="null != cardNumber and '' != cardNumber">
card_number,
</if>
<if test="null != cooperationStartTime ">
cooperation_start_time,
</if>
<if test="null != cooperationEndTime ">
cooperation_end_time,
</if>
<if test="null != money and '' != money">
money,
</if>
<if test="null != areaCode and '' != areaCode">
area_code,
</if>
<if test="null != address and '' != address">
address,
</if>
<if test="null != detailedAddress and '' != detailedAddress">
detailed_address,
</if>
<if test="null != commissionType and '' != commissionType">
commission_type,
</if>
<if test="null != commissionRate and '' != commissionRate">
commission_rate,
</if>
<if test="null != longitude and '' != longitude">
longitude,
</if>
<if test="null != latitude and '' != latitude">
latitude,
</if>
<if test="null != status and '' != status">
status,
</if>
<if test="null != delFlag and '' != delFlag">
del_flag,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != remark and '' != remark">
remark
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != name and '' != name">
#{name},
</if>
<if test="null != phone and '' != phone">
#{phone},
</if>
<if test="null != contactName and '' != contactName">
#{contactName},
</if>
<if test="null != contactPhone and '' != contactPhone">
#{contactPhone},
</if>
<if test="null != openBank and '' != openBank">
#{openBank},
</if>
<if test="null != cardNumber and '' != cardNumber">
#{cardNumber},
</if>
<if test="null != cooperationStartTime ">
#{cooperationStartTime},
</if>
<if test="null != cooperationEndTime ">
#{cooperationEndTime},
</if>
<if test="null != money and '' != money">
#{money},
</if>
<if test="null != areaCode and '' != areaCode">
#{areaCode},
</if>
<if test="null != address and '' != address">
#{address},
</if>
<if test="null != detailedAddress and '' != detailedAddress">
#{detailedAddress},
</if>
<if test="null != commissionType and '' != commissionType">
#{commissionType},
</if>
<if test="null != commissionRate and '' != commissionRate">
#{commissionRate},
</if>
<if test="null != longitude and '' != longitude">
#{longitude},
</if>
<if test="null != latitude and '' != latitude">
#{latitude},
</if>
<if test="null != status and '' != status">
#{status},
</if>
<if test="null != delFlag and '' != delFlag">
#{delFlag},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != remark and '' != remark">
#{remark}
</if>
</trim>
</insert>
<update id="update" parameterType="com.xhpc.user.domain.XhpcInternetUser">
UPDATE xhpc_internet_user
<set>
<if test="null != name and '' != name">name = #{name},</if>
<if test="null != phone and '' != phone">phone = #{phone},</if>
<if test="null != contactName and '' != contactName">contact_name = #{contactName},</if>
<if test="null != contactPhone and '' != contactPhone">contact_phone = #{contactPhone},</if>
<if test="null != openBank and '' != openBank">open_bank = #{openBank},</if>
<if test="null != cardNumber and '' != cardNumber">card_number = #{cardNumber},</if>
<if test="null != cooperationStartTime">cooperation_start_time =
#{cooperationStartTime},
</if>
<if test="null != cooperationEndTime">cooperation_end_time =
#{cooperationEndTime},
</if>
<if test="null != money and '' != money">money = #{money},</if>
<if test="null != areaCode and '' != areaCode">area_code = #{areaCode},</if>
<if test="null != address and '' != address">address = #{address},</if>
<if test="null != detailedAddress and '' != detailedAddress">detailed_address = #{detailedAddress},</if>
<if test="null != commissionType and '' != commissionType">commission_type = #{commissionType},</if>
<if test="null != commissionRate and '' != commissionRate">commission_rate = #{commissionRate},</if>
<if test="null != longitude and '' != longitude">longitude = #{longitude},</if>
<if test="null != latitude and '' != latitude">latitude = #{latitude},</if>
<if test="null != status and '' != status">status = #{status},</if>
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
<if test="null != createTime ">create_time = #{createTime},</if>
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
<if test="null != updateTime">update_time = #{updateTime},</if>
<if test="null != remark and '' != remark">remark = #{remark}</if>
</set>
WHERE internet_user_id = #{internetUserId}
</update>
<delete id="deleteByIds" parameterType="java.lang.Long">
delete from xhpc_internet_user where internet_user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{internetUserId}
</foreach>
</delete>
<select id="info" parameterType="java.lang.Long" resultType="java.util.Map">
select
xiu.internet_user_id internetUserId, xiu.`name`, xiu.phone, xiu.contact_name contactName,
xiu.contact_phone contactPhone, xiu.open_bank openBank, xiu.card_number cardNumber,
xiu.cooperation_start_time cooperationStartTime, xiu.cooperation_end_time cooperationEndTime,
xiu.money, xiu.area_code areaCode, xiu.address, xiu.detailed_address detailedAddress,
xiu.commission_type commissionType, xiu.commission_rate commissionRate,
xiu.longitude, xiu.latitude, xiu.`status`,
xiu.create_by createBy ,xiu.create_time createTime,
xiu.update_time updateTime, xiu.update_by updateBy,
xiu.del_flag delflag, xiu.remark ,
CASE WHEN xiu.`status` = 0 THEN '正常' else '禁用' end statusName,
CASE WHEN xiu.commission_type = 0 THEN '总金额提成' else '服务费提成' end commissionTypeName
from xhpc_internet_user xiu
LEFT JOIN sys_user su on su.internet_user_id = xiu.internet_user_id
WHERE xiu.del_flag = 0 and xiu.internet_user_id = #{internetUserId}
</select>
<select id="selectInternetList" parameterType="java.lang.Long" resultType="java.util.Map">
select
xiu.internet_user_id internetUserId, xiu.`name`, xiu.phone, xiu.contact_name contactName,
xiu.contact_phone contactPhone,xiu.create_time createTime,
xiu.commission_type commissionType, xiu.commission_rate commissionRate,
xiu.latitude, xiu.`status`,
CASE WHEN xiu.`status` = 0 THEN '正常' else '禁用' end statusName,
CASE WHEN xiu.commission_type = 0 THEN '总金额提成' else '服务费提成' end commissionTypeName
from xhpc_internet_user xiu
LEFT JOIN sys_user su on su.internet_user_id = xiu.internet_user_id
WHERE xiu.del_flag = 0
<if test="name != null and name != ''">
and xiu.name like concat(concat('%', #{name}), '%')
</if>
<if test="contactName != null and contactName != ''">
and xiu.contact_name like concat(concat('%', #{contactName}), '%')
</if>
<if test="contactPhone != null and contactPhone != ''">
and xiu.contact_phone like concat(concat('%', #{contactPhone}), '%')
</if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xiu.create_time &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''"><!-- 结束时间检索 -->
AND xiu.create_time &lt;= #{createTimeEnd}
</if>
ORDER BY xiu.update_time DESC
</select>
<select id="getUserByInternetUserId" parameterType="java.lang.Long"
resultType="com.ruoyi.system.api.domain.SysUser">
select *
from sys_user
where del_flag = 0 and internet_user_id = #{internetUserId}
</select>
<select id="list" parameterType="java.lang.Long" resultType="java.util.Map">
select
xiu.internet_user_id internetUserId, xiu.`name`, xiu.phone, xiu.contact_name contactName,
xiu.contact_phone contactPhone,
xiu.commission_type commissionType, xiu.commission_rate commissionRate,
xiu.latitude, xiu.`status`,
CASE WHEN xiu.`status` = 0 THEN '正常' else '禁用' end statusName,
CASE WHEN xiu.commission_type = 0 THEN '总金额提成' else '服务费提成' end commissionTypeName
from xhpc_internet_user xiu
LEFT JOIN sys_user su on su.internet_user_id = xiu.internet_user_id
WHERE xiu.del_flag = 0
<if test="name != null and name != ''">
and xiu.name like concat(concat('%', #{name}), '%')
</if>
ORDER BY xiu.update_time DESC
</select>
</mapper>