<?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.yida.data.customForm.mapper.CoreCustomFormRelationUserMapper">

    <select id="findUserNum" resultType="java.lang.Integer">
    SELECT
	    COUNT(id)
    FROM
	    `core_custom_form_relation_user`
    WHERE
	    custom_form_id = #{id}
    </select>
    <select id="findNotCommit" resultType="java.lang.Integer">
    SELECT
	    COUNT(id)
    FROM
	    `core_custom_form_relation_user`
    WHERE
	    custom_form_id = #{id}
	    and fill = 0
    </select>
    <select id="findUserList"
            resultType="com.yida.data.common.core.entity.customform.CoreCustomFormRelationUser">
    SELECT
	*
    FROM
	`core_custom_form_relation_user`
    WHERE
    fill = #{type}
    <if test="name != null and name !=''">
        AND user_name LIKE CONCAT( '%', #{name}, '%' )
    </if>

	AND custom_form_id = #{formId}

    </select>
</mapper>
