104 lines
5.3 KiB
XML
104 lines
5.3 KiB
XML
<?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.bonus.gzrn.rnbmw.person.dao.PersonTrainDao">
|
|
|
|
<insert id="insertUserTrainInfo" parameterType="com.bonus.gzrn.rnbmw.person.entity.UserTrainInfoBean" >
|
|
INSERT INTO bm_worker_train
|
|
(`id_number`, `trainType`, `projectType`, `source`, `yetAnswered`, `correctAnswered`,
|
|
`subjectiveScore`, `totalStudytime`, `trainStudytime`, `trainStatus`, `standStartTime`,
|
|
`standEndTime`, `examStatus`, `examScore`, `examTime`, `examTimeInfo`, `answerStudytime`,
|
|
`correctRate`, `standardStudyTime`, `requirementStudytime`, `totalQuestion`, `isMakeUp`,
|
|
`makeUpCount`, `makeUpScore`, `projectStatus`, `projectStartTime`, `is_active`)
|
|
VALUES (#{userId}, #{trainType},#{projectType}, #{source}, #{yetAnswered}, #{correctAnswered},
|
|
'1', #{totalStudytime}, #{trainStudytime}, #{trainStatus}, #{standStartTime},
|
|
#{standEndTime}, #{examStatus}, #{examScore}, #{examTime}, #{examTimeInfo}, #{answerStudytime},
|
|
#{correctRate}, #{standardStudyTime}, #{requirementStudytime}, #{totalQuestion}, #{isMakeUp},
|
|
#{makeUpCount}, #{makeUpScore}, #{projectStatus}, #{projectStartTime}, '1');
|
|
</insert>
|
|
|
|
|
|
<select id="getWorkerTrainList" resultType="com.bonus.gzrn.rnbmw.person.entity.UserTrainInfoBean">
|
|
SELECT
|
|
bwr.PROJECT_ID as `id`,bp.name as projectName,bw.name as `userName`,bwt.id_number as `userId`,sdd.name as postId,
|
|
bwt.trainStatus as trainStatus,bwt.trainType as trainType,bwt.totalStudytime as `totalStudytime`,bwt.trainStudytime as `trainStudytime`,
|
|
bwt.examStatus as `examStatus`,bwt.examScore as `examScore`
|
|
FROM bm_worker_train bwt
|
|
LEFT JOIN bm_worker_record bwr ON bwr.ID_NUMBER = bwt.id_number
|
|
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = bwt.id_number
|
|
LEFT JOIN bm_project bp ON bp.ID = bwr.PROJECT_ID
|
|
LEFT JOIN sys_dic_detail sdd ON sdd.id = bwr.post_id
|
|
WHERE 1 = 1
|
|
<!-- <if test="bean.orgId != null and bean.orgId != ''">-->
|
|
<!-- and bwr.orgId = #{bean.orgId}-->
|
|
<!-- </if>-->
|
|
<if test="bean.proId != null and bean.proId != ''">
|
|
and bwr.PROJECT_ID = #{bean.proId}
|
|
</if>
|
|
<if test="bean.trainStatus != null and bean.trainStatus != ''">
|
|
and bwt.trainStatus = #{bean.trainStatus}
|
|
</if>
|
|
<if test="bean.examStatus != null and bean.examStatus != ''">
|
|
and bwt.examStatus = #{bean.examStatus}
|
|
</if>
|
|
<if test="bean.keyWord != null and bean.keyWord != ''">
|
|
and(
|
|
bp.name like CONCAT('%',#{bean.keyWord},'%') or
|
|
bwt.id_number like CONCAT('%',#{bean.keyWord},'%') or
|
|
bw.name like CONCAT('%',#{bean.keyWord},'%')
|
|
)
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getWorkerTrainCount" resultType="java.lang.Integer">
|
|
SELECT
|
|
count (1)
|
|
FROM bm_worker_train bwt
|
|
LEFT JOIN bm_worker_record bwr ON bwr.ID_NUMBER = bwt.id_number
|
|
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = bwt.id_number
|
|
LEFT JOIN bm_project bp ON bp.ID = bwr.PROJECT_ID
|
|
LEFT JOIN sys_dic_detail sdd ON sdd.id = bwr.post_id
|
|
WHERE 1 = 1
|
|
<!-- <if test="bean.orgId != null and bean.orgId != ''">-->
|
|
<!-- and bwr.orgId = #{bean.orgId}-->
|
|
<!-- </if>-->
|
|
<if test="bean.proId != null and bean.proId != ''">
|
|
and bwr.PROJECT_ID = #{bean.proId}
|
|
</if>
|
|
<if test="bean.trainStatus != null and bean.trainStatus != ''">
|
|
and bwt.trainStatus = #{bean.trainStatus}
|
|
</if>
|
|
<if test="bean.examStatus != null and bean.examStatus != ''">
|
|
and bwt.examStatus = #{bean.examStatus}
|
|
</if>
|
|
<if test="bean.keyWord != null and bean.keyWord != ''">
|
|
and(
|
|
bp.name like CONCAT('%',#{bean.keyWord},'%') or
|
|
bwt.id_number like CONCAT('%',#{bean.keyWord},'%') or
|
|
bw.name like CONCAT('%',#{bean.keyWord},'%')
|
|
)
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getWorkerTrainById" resultType="com.bonus.gzrn.rnbmw.person.entity.UserTrainInfoBean">
|
|
SELECT bwt.id_number AS userId,bwt.trainType,bwt.projectType AS projectType,bwt.source,bwt.yetAnswered,
|
|
bwt.correctAnswered,bwt.subjectiveScore,bwt.totalStudytime,bwt.trainStudytime,
|
|
bwt.trainStatus,bwt.standStartTime,bwt.standEndTime,bwt.examStatus,
|
|
bwt.examScore,bwt.examTime,bwt.examTimeInfo,bwt.answerStudytime,bwt.correctRate,
|
|
bwt.standardStudyTime,bwt.requirementStudytime,bwt.totalQuestion,
|
|
bwt.isMakeUp,bwt.makeUpCount,bwt.makeUpScore,sdd.name as postId,
|
|
bwt.projectStatus,bwt.projectStartTime,bwt.is_active,bp.name as projectName,bw.name as `userName`
|
|
FROM
|
|
bm_worker_train bwt
|
|
LEFT JOIN bm_worker_record bwr ON bwr.ID_NUMBER = bwt.id_number
|
|
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = bwt.id_number
|
|
LEFT JOIN bm_project bp ON bp.ID = bwr.PROJECT_ID
|
|
LEFT JOIN sys_dic_detail sdd ON sdd.id = bwr.post_id
|
|
WHERE bwt.id_number = #{id}
|
|
</select>
|
|
|
|
<select id="getWorkerIdCount" resultType="java.lang.String">
|
|
select ID_NUMBER as idNumber from bm_worker
|
|
</select>
|
|
|
|
</mapper> |