zcloud_gbs_edu/web-infrastructure/src/main/resources/mapper/TrainingApplyUserMapper.xml

55 lines
1.7 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?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.zcloud.edu.persistence.mapper.TrainingApplyUserMapper">
<!-- 根据申请记录ID查询申请人员含用户信息-->
<select id="selectByRecordId" resultType="com.zcloud.edu.persistence.dataobject.TrainingApplyUserDO">
SELECT
tau.id,
tau.training_apply_user_id as trainingApplyUserId,
tau.training_apply_record_id as trainingApplyRecordId,
tau.user_id as userId,
tau.phone,
tau.apply_status as applyStatus,
tau.remarks,
u.username,
tau.id_card as idCard
FROM
training_apply_user tau
LEFT JOIN
user u ON tau.user_id = u.id
AND u.delete_enum = 'false'
WHERE
tau.training_apply_record_id = #{trainingApplyRecordId}
AND tau.delete_enum = 'false'
ORDER BY
tau.create_time ASC
</select>
<select id="selectByPhoneList" resultType="com.zcloud.edu.persistence.dataobject.TrainingApplyUserDO">
SELECT
u.id as userId,
u.phone
FROM
`user` u
WHERE
u.corpinfo_id = #{corpinfoId}
<if test="phones != null and phones.size() > 0">
AND u.phone IN
<foreach collection="phones" item="phone" open="(" separator="," close=")">
#{phone}
</foreach>
</if>
<if test="phones == null or phones.size() == 0">
AND 1 = 0
</if>
</select>
</mapper>