| | |
| | | <select id="selectListByTrainingDetailedId" resultType="com.ruoyi.personnel.dto.PersonTrainingRecordDto"> |
| | | select cptr.*, |
| | | u.name userName, |
| | | dl.name department |
| | | dl.name department, |
| | | u.signature_url |
| | | from cnas_person_training_record cptr |
| | | left join user u on u.id = cptr.user_id |
| | | left join department_lims dl on find_in_set(dl.id, u.depart_lims_id) and dl.id != 1 |
| | |
| | | dl.name depart_lims_name, |
| | | cpbi.professional_title, |
| | | cpbi.official_academic_redentials, |
| | | cpbi.unit_time, |
| | | cpbi.major1, |
| | | u.id user_id, |
| | | DATE_FORMAT(cpbi.unit_time, '%Y-%m-%d') AS unitTimeSting |
| | | DATE_FORMAT(cpbi.group_time, '%Y-%m-%d') AS unitTimeSting |
| | | from user u |
| | | left join cnas_person_basic_info cpbi on cpbi.user_id = u.id |
| | | left join department_lims dl on dl.id = SUBSTRING_INDEX(SUBSTRING_INDEX(u.depart_lims_id, ',', -2), ',', 1) |
| | |
| | | and cptr.user_id = #{userId} |
| | | <where> |
| | | <if test="year!= null and year!= ''"> |
| | | and YEAR(cptd.training_date) = ${year} |
| | | and cptd.training_date like concat('%', #{year}, '%')} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | and cptr.user_id = #{userId} |
| | | </if> |
| | | <if test="year!= null and year!= ''"> |
| | | and YEAR(cptd.training_date) = ${year} |
| | | and cptd.training_date like concat('%', #{year}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | cptd.class_hour, |
| | | cptr.examination_results, |
| | | cptd.remarks, |
| | | DATE_FORMAT(cptd.training_date, '%Y-%m-%d') AS trainingDateString |
| | | cptd.training_date AS trainingDateString |
| | | from cnas_person_training_record cptr |
| | | inner join cnas_person_training_detailed cptd on cptd.id = cptr.course_id |
| | | and cptr.user_id = #{userId} |
| | | <where> |
| | | <if test="year!= null and year!= ''"> |
| | | and YEAR(cptd.training_date) = ${year} |
| | | and cptd.training_date like concat('%', #{year}, '%') |
| | | </if> |
| | | </where> |
| | | order by STR_TO_DATE(CONCAT(cptd.training_date, '.01'), '%Y.%m.%d') |
| | | |
| | | </select> |
| | | </mapper> |