<?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.superdesk.uniorder.dao.mapper.sys.SysOderUserMapperEx">


	<select id="findAll" resultMap="cn.superdesk.uniorder.dao.mapper.sys.SysOderUserMapper.BaseResultMap">
		select
		<include refid="cn.superdesk.uniorder.dao.mapper.sys.SysOderUserMapper.Base_Column_List"/>
		from sys_oder_user where 1=1

		<if test="projectId != null and projectId != ''">
			and organization_id = #{projectId,jdbcType=BIGINT}
		</if>
		<if test="virtId != null and virtId != ''">
			and enterprise_id = #{virtId,jdbcType=BIGINT}
		</if>
		<if test="mobile != null and mobile != ''">
			and mobile like CONCAT('%',#{mobile,jdbcType=VARCHAR},'%')
		</if>
		<if test="fullname != null and fullname != ''">
			and realname like CONCAT('%',#{fullname,jdbcType=VARCHAR},'%')
		</if>
		LIMIT 100
	</select>


	<!-- 自定义部分 -->
	<select id="selectByUserId" parameterType="java.lang.Long" resultMap="cn.superdesk.uniorder.dao.mapper.sys.SysOderUserMapper.BaseResultMap">
		select
		<include refid="cn.superdesk.uniorder.dao.mapper.sys.SysOderUserMapper.Base_Column_List"/>
		from sys_oder_user
		where user_id = #{userId,jdbcType=BIGINT}
	</select>

	<select id="findByUserId" parameterType="java.lang.Long" resultMap="cn.superdesk.uniorder.dao.mapper.sys.SysOderUserMapper.BaseResultMap">
		select
		<include refid="cn.superdesk.uniorder.dao.mapper.sys.SysOderUserMapper.Base_Column_List"/>
		from sys_oder_user
		where user_id = #{ordId,jdbcType=BIGINT}
	</select>

</mapper>