<?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.kxs.user.biz.mapper.KxsTotalDebtMapper">

    <resultMap type="com.kxs.user.api.model.KxsTotalDebt" id="KxsTotalDebtMap">
        <result column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="del_flag" property="delFlag" />
        <result column="version" property="version" />
        <result column="user_id" property="userId" />
        <result column="total_debt" property="totalDebt" />
        <result column="create_by" property="createBy" />
        <result column="remark" property="remark" />

    </resultMap>
    <select id="getByPage" resultType="com.kxs.user.api.vo.admin.totalDebt.TotalDebtListVO">
        SELECT a.*, u.username, u.user_code from kxs_total_debt a
        LEFT JOIN kxs_user u on a.user_id = u.id
        <where>
            a.del_flag = 0
            <if test="keyword != null and keyword !=''">
               and (u.username like concat('%' #{keyword} '%') or u.phone like concat('%' #{keyword} '%') or u.user_code like concat('%' #{keyword} '%'))
            </if>

        </where>
    </select>

</mapper>
