| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?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.fs.course.mapper.FsUserProjectQwMapper">
- <insert id="insertOrIgnore">
- INSERT INTO fs_user_project_qw (
- fs_user_id, project_id, qw_user_id, company_id, first_bind_time, update_time
- ) VALUES (
- #{fsUserId}, #{projectId}, #{qwUserId}, #{companyId}, NOW(), NOW()
- )
- ON DUPLICATE KEY UPDATE update_time = NOW()
- </insert>
- <select id="countDistinctQwUser" resultType="int">
- SELECT COUNT(DISTINCT qw_user_id)
- FROM fs_user_project_qw
- WHERE fs_user_id = #{fsUserId}
- AND qw_user_id IS NOT NULL
- <if test="equivalentProjectIds != null and equivalentProjectIds.size() > 0">
- AND project_id IN
- <foreach collection="equivalentProjectIds" item="pid" open="(" separator="," close=")">
- #{pid}
- </foreach>
- </if>
- </select>
- <select id="existsQwUserInProjects" resultType="int">
- SELECT COUNT(1)
- FROM fs_user_project_qw
- WHERE fs_user_id = #{fsUserId}
- AND qw_user_id = #{qwUserId}
- <if test="equivalentProjectIds != null and equivalentProjectIds.size() > 0">
- AND project_id IN
- <foreach collection="equivalentProjectIds" item="pid" open="(" separator="," close=")">
- #{pid}
- </foreach>
- </if>
- LIMIT 1
- </select>
- </mapper>
|