|
|
|
|
<?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="cc.hiver.mall.debt.mapper.DebtMapper">
|
|
|
|
|
<resultMap id="BaseResultMap" type="cc.hiver.mall.debt.entity.Debt">
|
|
|
|
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
|
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
|
<result column="del_flag" jdbcType="INTEGER" property="delFlag" />
|
|
|
|
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
|
|
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
|
|
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
|
|
|
|
|
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
|
|
|
|
<result column="user_name" jdbcType="INTEGER" property="userName" />
|
|
|
|
|
<result column="user_phone" jdbcType="INTEGER" property="userPhone" />
|
|
|
|
|
<result column="user_adress" jdbcType="VARCHAR" property="userAdress" />
|
|
|
|
|
<result column="amount_owed" jdbcType="VARCHAR" property="amountOwed" />
|
|
|
|
|
<result column="user_type" jdbcType="VARCHAR" property="userType" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
id, create_by, create_time, del_flag, update_by, update_time,shop_id, user_id, user_name, user_phone, user_adress, amount_owed, user_type
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<!--根据店铺id查询欠款列表-->
|
|
|
|
|
<select id="getDebtByShopId" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from t_debt
|
|
|
|
|
where del_flag = 0
|
|
|
|
|
and shop_id = #{queryDebtVo.shopId,jdbcType=VARCHAR}
|
|
|
|
|
and user_type = #{queryDebtVo.userType,jdbcType=VARCHAR}
|
|
|
|
|
order by create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectByUserId" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from t_debt
|
|
|
|
|
where del_flag = 0
|
|
|
|
|
and shop_id = #{shopId,jdbcType=VARCHAR}
|
|
|
|
|
and user_id = #{userId,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getDebtByUserIds" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from t_debt
|
|
|
|
|
where del_flag = 0
|
|
|
|
|
and user_id in
|
|
|
|
|
<foreach close=")" collection="userIds" item="listItem" open="(" separator=",">
|
|
|
|
|
#{listItem}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|