wenhui 70f3c8b6f4 修复tradebill服务无法启动问题,
修复卡查询用户接口,增加模糊查询与绑定过滤
2022-03-02 11:16:51 +08:00

320 lines
14 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">
<!--suppress ALL -->
<mapper namespace="com.xhpc.card.mapper.XhpcAppUserMapper">
<resultMap id="BaseResultMap" type="com.xhpc.card.pojo.XhpcAppUser">
<id column="app_user_id" jdbcType="BIGINT" property="appUserId"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="weixin_open_id" jdbcType="VARCHAR" property="weixinOpenId"/>
<result column="alipay_open_id" jdbcType="VARCHAR" property="alipayOpenId"/>
<result column="weixin_login" jdbcType="INTEGER" property="weixinLogin"/>
<result column="alipay_login" jdbcType="INTEGER" property="alipayLogin"/>
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
<result column="balance" jdbcType="DECIMAL" property="balance"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="is_refund_application" jdbcType="INTEGER" property="isRefundApplication"/>
<result column="del_flag" jdbcType="CHAR" property="delFlag"/>
<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="remark" jdbcType="VARCHAR" property="remark"/>
<result column="soc" jdbcType="INTEGER" property="soc"/>
<result column="is_refund" jdbcType="INTEGER" property="isRefund"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="soc_protect" jdbcType="INTEGER" property="socProtect"/>
</resultMap>
<sql id="Base_Column_List">
app_user_id
, phone, weixin_open_id, alipay_open_id, weixin_login, alipay_login, avatar,
balance, `password`, `status`, is_refund_application, del_flag, create_by, create_time,
update_by, update_time, remark, soc, is_refund, tenant_id, soc_protect
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from xhpc_app_user
where app_user_id = #{appUserId,jdbcType=BIGINT}
</select>
<select id="selectCount" resultType="java.lang.Long">
select count(app_user_id)
from xhpc_app_user
<where>
<if test="queryCondition.userAccount!=null and queryCondition.userAccount!='' ">
and phone like concat('%',#{queryCondition.userAccount},'%')
</if>
<if test="userIdList!=null and userIdList.size()!=0">
and app_user_id not in
<foreach collection="userIdList" item="userId" open="(" close=")" separator=",">
#{userId}
</foreach>
</if>
</where>
</select>
<select id="selectByCondition" resultType="com.xhpc.card.pojo.XhpcAppUser">
select
<include refid="Base_Column_List"/>
from xhpc_app_user
<where>
<if test="queryCondition.userAccount!=null and queryCondition.userAccount!='' ">
and phone like concat('%',#{queryCondition.userAccount},'%')
</if>
<if test="userIdList!=null and userIdList.size()!=0">
and app_user_id not in
<foreach collection="userIdList" item="userId" open="(" close=")" separator=",">
#{userId}
</foreach>
</if>
</where>
limit #{queryCondition.currentPage},#{queryCondition.items}
</select>
<select id="selectByPhone" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from xhpc_app_user
<where>
phone = #{userAccount}
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete
from xhpc_app_user
where app_user_id = #{appUserId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="app_user_id" keyProperty="appUserId" parameterType="com.xhpc.card.pojo.XhpcAppUser"
useGeneratedKeys="true">
insert into xhpc_app_user (phone, weixin_open_id, alipay_open_id,
weixin_login, alipay_login, avatar,
balance, `password`, `status`,
is_refund_application, del_flag, create_by,
create_time, update_by, update_time,
remark, soc, is_refund,
tenant_id, soc_protect)
values (#{phone,jdbcType=VARCHAR}, #{weixinOpenId,jdbcType=VARCHAR}, #{alipayOpenId,jdbcType=VARCHAR},
#{weixinLogin,jdbcType=INTEGER}, #{alipayLogin,jdbcType=INTEGER}, #{avatar,jdbcType=VARCHAR},
#{balance,jdbcType=DECIMAL}, #{password,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{isRefundApplication,jdbcType=INTEGER}, #{delFlag,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR}, #{soc,jdbcType=INTEGER}, #{isRefund,jdbcType=INTEGER},
#{tenantId,jdbcType=VARCHAR}, #{socProtect,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="app_user_id" keyProperty="appUserId"
parameterType="com.xhpc.card.pojo.XhpcAppUser" useGeneratedKeys="true">
insert into xhpc_app_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="phone != null">
phone,
</if>
<if test="weixinOpenId != null">
weixin_open_id,
</if>
<if test="alipayOpenId != null">
alipay_open_id,
</if>
<if test="weixinLogin != null">
weixin_login,
</if>
<if test="alipayLogin != null">
alipay_login,
</if>
<if test="avatar != null">
avatar,
</if>
<if test="balance != null">
balance,
</if>
<if test="password != null">
`password`,
</if>
<if test="status != null">
`status`,
</if>
<if test="isRefundApplication != null">
is_refund_application,
</if>
<if test="delFlag != null">
del_flag,
</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="remark != null">
remark,
</if>
<if test="soc != null">
soc,
</if>
<if test="isRefund != null">
is_refund,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="socProtect != null">
soc_protect,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="weixinOpenId != null">
#{weixinOpenId,jdbcType=VARCHAR},
</if>
<if test="alipayOpenId != null">
#{alipayOpenId,jdbcType=VARCHAR},
</if>
<if test="weixinLogin != null">
#{weixinLogin,jdbcType=INTEGER},
</if>
<if test="alipayLogin != null">
#{alipayLogin,jdbcType=INTEGER},
</if>
<if test="avatar != null">
#{avatar,jdbcType=VARCHAR},
</if>
<if test="balance != null">
#{balance,jdbcType=DECIMAL},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="isRefundApplication != null">
#{isRefundApplication,jdbcType=INTEGER},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=CHAR},
</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="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="soc != null">
#{soc,jdbcType=INTEGER},
</if>
<if test="isRefund != null">
#{isRefund,jdbcType=INTEGER},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=VARCHAR},
</if>
<if test="socProtect != null">
#{socProtect,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.card.pojo.XhpcAppUser">
update xhpc_app_user
<set>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="weixinOpenId != null">
weixin_open_id = #{weixinOpenId,jdbcType=VARCHAR},
</if>
<if test="alipayOpenId != null">
alipay_open_id = #{alipayOpenId,jdbcType=VARCHAR},
</if>
<if test="weixinLogin != null">
weixin_login = #{weixinLogin,jdbcType=INTEGER},
</if>
<if test="alipayLogin != null">
alipay_login = #{alipayLogin,jdbcType=INTEGER},
</if>
<if test="avatar != null">
avatar = #{avatar,jdbcType=VARCHAR},
</if>
<if test="balance != null">
balance = #{balance,jdbcType=DECIMAL},
</if>
<if test="password != null">
`password` = #{password,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="isRefundApplication != null">
is_refund_application = #{isRefundApplication,jdbcType=INTEGER},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=CHAR},
</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="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="soc != null">
soc = #{soc,jdbcType=INTEGER},
</if>
<if test="isRefund != null">
is_refund = #{isRefund,jdbcType=INTEGER},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=VARCHAR},
</if>
<if test="socProtect != null">
soc_protect = #{socProtect,jdbcType=INTEGER},
</if>
</set>
where app_user_id = #{appUserId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.xhpc.card.pojo.XhpcAppUser">
update xhpc_app_user
set phone = #{phone,jdbcType=VARCHAR},
weixin_open_id = #{weixinOpenId,jdbcType=VARCHAR},
alipay_open_id = #{alipayOpenId,jdbcType=VARCHAR},
weixin_login = #{weixinLogin,jdbcType=INTEGER},
alipay_login = #{alipayLogin,jdbcType=INTEGER},
avatar = #{avatar,jdbcType=VARCHAR},
balance = #{balance,jdbcType=DECIMAL},
`password` = #{password,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
is_refund_application = #{isRefundApplication,jdbcType=INTEGER},
del_flag = #{delFlag,jdbcType=CHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR},
soc = #{soc,jdbcType=INTEGER},
is_refund = #{isRefund,jdbcType=INTEGER},
tenant_id = #{tenantId,jdbcType=VARCHAR},
soc_protect = #{socProtect,jdbcType=INTEGER}
where app_user_id = #{appUserId,jdbcType=BIGINT}
</update>
</mapper>