No Description

TPubTrainsignoutMapper.xml 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.yt.zhylplat.modulePub.mapper.TPubTrainMapper">
  4. <select id="acquireTraind" resultType="com.yt.zhylplat.modulePub.entity.TPubTrain">
  5. SELECT
  6. t.id,
  7. t.train_id,
  8. t.create_date,
  9. train_title,
  10. train_name,
  11. file_old_name AS fileName,
  12. file_type AS fileType,
  13. file_url,
  14. meeting_note_url,
  15. meeting_sign_url,
  16. class_file_url,
  17. photo_live_url,
  18. summarize_url,
  19. meeting_note_name,
  20. meeting_sign_name,
  21. class_file_name,
  22. photo_live_name,
  23. summarize_name,
  24. remark
  25. FROM
  26. T_Pub_Train AS t
  27. left JOIN ( SELECT table_id,create_user_id,file_old_name, file_type, file_url FROM T_File f WHERE f.table_name = 'T_Pub_Train' AND delete_flag = 0 ORDER BY table_id ) AS fl
  28. ON
  29. fl.table_id=t.id
  30. <where>
  31. <if test="tPubTrain.trainTitle!=null and tPubTrain.trainTitle!=''">
  32. and t.train_title like concat('%',#{tPubTrain.trainTitle},'%')
  33. </if>
  34. </where>
  35. </select>
  36. <select id="getTrainModelById" resultType="com.yt.zhylplat.moduleExcel.model.TrainModel">
  37. select
  38. train_title,
  39. train_name,
  40. train_content,
  41. train_address,
  42. concat(start_time, '至', end_time) as trainTime
  43. from
  44. T_Pub_Train
  45. where
  46. id = #{id}
  47. </select>
  48. <select id="selectTrainModelList" resultType="com.yt.zhylplat.moduleExcel.model.TrainModel">
  49. select
  50. yh.F_DeptName as yhCompany,
  51. tu.train_staff_name as trainStaffName,
  52. case
  53. when ts.leave_type is null then '缺勤'
  54. when ts.leave_type = 0 then '正常签到'
  55. when ts.leave_type = 1 then '缺勤'
  56. when ts.leave_type = 2 then '代签'
  57. end as leaveType,
  58. case
  59. when ts.sign_type is null then '缺勤'
  60. when ts.sign_type = 1 then '签到'
  61. when ts.sign_type = 2 then '签退'
  62. end as signType,
  63. case
  64. when ts.sign_type is null then ''
  65. when ts.sign_type = 1 then sign_time
  66. when ts.sign_type = 2 then sign_out_time
  67. end as signOutTime
  68. from
  69. T_Pub_Train_Userinfo tu
  70. left join
  71. T_Pub_TrainSignOut ts on tu.train_id = ts.train_id and tu.train_staff_id = ts.train_staff_id
  72. left join
  73. T_Base_YHCompany yh on tu.yhcompany_id = yh.F_YHCompanyId
  74. where
  75. tu.train_id = #{id}
  76. </select>
  77. <select id="trainMessage" resultType="com.yt.zhylplat.modulePub.entity.TPubTrain">
  78. SELECT
  79. t.id,
  80. t.train_id,
  81. t.create_date,
  82. train_title,
  83. train_name,
  84. file_old_name AS fileName,
  85. file_type AS fileType,
  86. file_url,
  87. meeting_note_url,
  88. meeting_sign_url,
  89. class_file_url,
  90. photo_live_url,
  91. summarize_url,
  92. meeting_note_name,
  93. meeting_sign_name,
  94. class_file_name,
  95. photo_live_name,
  96. summarize_name
  97. FROM
  98. T_Pub_Train AS t
  99. left JOIN ( SELECT table_id,create_user_id,file_old_name, file_type, file_url FROM T_File f WHERE f.table_name = 'T_Pub_Train' AND delete_flag = 0 ORDER BY table_id ) AS fl
  100. ON
  101. fl.table_id=t.id
  102. <where>
  103. <if test="tPubTrain.trainTitle!=null and tPubTrain.trainTitle!=''">
  104. and t.train_title like concat('%',#{tPubTrain.trainTitle},'%')
  105. </if>
  106. </where>
  107. </select>
  108. </mapper>