<?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="cn.com.ty.lift.ud.userAgreement.mapper.UserAgreementMapper">

   <select id="selectByQuery" resultType="cn.com.ty.lift.ud.userAgreement.mapper.entity.UserAgreement" >
    SELECT ua.*,ui.name nickname ,ui.avatar_url headUrl FROM user_agreement ua LEFT JOIN user_info ui ON ua.create_user_id=ui.user_id
    <where>
        ${ew.sqlSegment}
    </where>
     limit #{page.pageIndex},#{page.pageSize}
  </select>
  <select id="countByQuery" resultType="java.lang.Integer">
    select count(0)  FROM user_agreement ua LEFT JOIN user_info ui ON ua.create_user_id=ui.user_id
    <where>
        ${ew.sqlSegment}
    </where>
  </select>
</mapper>