201 lines
7.5 KiB
XML
201 lines
7.5 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.NoSignalTeamApplyDao">
|
|
<insert id="addNoSignalTeamApply" useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO
|
|
bm_no_signal_team(sub_id,pro_id,team_id,start_time,stop_time,remark,upload_id,examine_status)
|
|
VALUES(#{subId},#{proId},#{teamId},#{startTime},#{stopTime},#{remark},#{uploadId},'0')
|
|
</insert>
|
|
<insert id="addNoSignalTeamApplyFile">
|
|
INSERT INTO
|
|
bm_no_signal_team_file(no_signal_team_id,file_name,file_path,is_active)
|
|
VALUES(#{id},#{fileName},#{file},'1')
|
|
</insert>
|
|
<update id="updNoSignalTeamApply">
|
|
UPDATE bm_no_signal_team
|
|
SET
|
|
sub_id = #{subId},
|
|
pro_id = #{proId},
|
|
team_id = #{teamId},
|
|
start_time = #{startTime},
|
|
stop_time = #{stopTime},
|
|
remark = #{remark},
|
|
examine_status = '0',
|
|
update_time = now()
|
|
WHERE id = #{id}
|
|
</update>
|
|
<delete id="delFile">
|
|
delete from bm_no_signal_team_file where id =#{fileId}
|
|
</delete>
|
|
|
|
<select id="getNoSignalTeamApplyList" resultType="com.bonus.gzrn.rnbmw.person.entity.NoSignalTeamApplyBean">
|
|
SELECT
|
|
bnst.id AS id,
|
|
bp.ID AS proId,
|
|
bp.`name` AS proName,
|
|
bs.ID AS subId,
|
|
bs.SUB_NAME AS subName,
|
|
bst.ID AS teamId,
|
|
bst.`NAME` AS teamName,
|
|
bnst.start_time AS startTime,
|
|
bnst.stop_time AS stopTime,
|
|
bnst.remark AS remark,
|
|
bnst.examine_status AS examineStatus,
|
|
bnst.examine_opinion AS examineOpinion,
|
|
bnst.upload_id AS uploadId,
|
|
su.USERNAME AS uploadName,
|
|
GROUP_CONCAT(bnstf.file_name) AS fileName,
|
|
GROUP_CONCAT(bnstf.file_path) AS filePath
|
|
|
|
FROM bm_no_signal_team bnst
|
|
LEFT JOIN bm_no_signal_team_file bnstf ON bnstf.no_signal_team_id = bnst.id
|
|
LEFT JOIN bm_project bp ON bp.ID = bnst.pro_id
|
|
LEFT JOIN bm_subcontractor bs ON bs.ID = bnst.sub_id
|
|
LEFT JOIN bm_sub_team bst ON bst.ID = bnst.team_id
|
|
LEFT JOIN sys_user su ON su.ID = bnst.upload_id
|
|
WHERE bnst.is_active = 1
|
|
<if test="params.keyWord!=null and params.keyWord!='' ">
|
|
and (
|
|
bp.`name` like concat ('%',#{params.keyWord},'%') or
|
|
bs.SUB_NAME like concat ('%',#{params.keyWord},'%') or
|
|
bst.`NAME` like concat ('%',#{params.keyWord},'%')
|
|
)
|
|
</if>
|
|
<if test="params.examineStatus!=null and params.examineStatus!=''">
|
|
and bnst.examine_status = #{params.examineStatus}
|
|
</if>
|
|
GROUP BY bnst.id
|
|
limit #{offset}, #{limit}
|
|
</select>
|
|
|
|
<select id="getNoSignalTeamApplyCount" resultType="java.lang.Integer">
|
|
SELECT COUNT(1)
|
|
FROM(
|
|
SELECT
|
|
bnst.id AS id,
|
|
bp.ID AS proId,
|
|
bp.`name` AS proName,
|
|
bs.ID AS subId,
|
|
bs.SUB_NAME AS subName,
|
|
bst.ID AS teamId,
|
|
bst.`NAME` AS teamName,
|
|
bnst.start_time AS startTime,
|
|
bnst.stop_time AS stopTime,
|
|
bnst.remark AS remark,
|
|
bnst.examine_status AS examineStatus,
|
|
bnst.examine_opinion AS examineOpinion,
|
|
bnst.upload_id AS uploadId,
|
|
su.USERNAME AS uploadName,
|
|
GROUP_CONCAT(bnstf.file_name) AS fileName,
|
|
GROUP_CONCAT(bnstf.file_path) AS filePath
|
|
|
|
FROM bm_no_signal_team bnst
|
|
LEFT JOIN bm_no_signal_team_file bnstf ON bnstf.no_signal_team_id = bnst.id
|
|
LEFT JOIN bm_project bp ON bp.ID = bnst.pro_id
|
|
LEFT JOIN bm_subcontractor bs ON bs.ID = bnst.sub_id
|
|
LEFT JOIN bm_sub_team bst ON bst.ID = bnst.team_id
|
|
LEFT JOIN sys_user su ON su.ID = bnst.upload_id
|
|
WHERE bnst.is_active = 1
|
|
<if test="params.keyWord!=null and params.keyWord!='' ">
|
|
and (
|
|
bp.`name` like concat ('%',#{params.keyWord},'%') or
|
|
bs.SUB_NAME like concat ('%',#{params.keyWord},'%') or
|
|
bst.`NAME` like concat ('%',#{params.keyWord},'%')
|
|
)
|
|
</if>
|
|
<if test="params.examineStatus!=null and params.examineStatus!='' and params.examineStatus!='-1' and params.examineStatus!=-1">
|
|
and bnst.examine_status = #{params.examineStatus}
|
|
</if>
|
|
GROUP BY bnst.id
|
|
) a
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getSub" resultType="com.bonus.gzrn.rnbmw.person.entity.NoSignalTeamApplyBean">
|
|
SELECT
|
|
bs.id AS id,
|
|
bs.SUB_NAME AS name
|
|
FROM bm_subcontractor bs
|
|
WHERE IS_ACTIVE = '1'
|
|
</select>
|
|
<select id="getPro" resultType="com.bonus.gzrn.rnbmw.person.entity.NoSignalTeamApplyBean">
|
|
SELECT
|
|
bp.id AS id,
|
|
bp.`name` AS name
|
|
FROM bm_project bp
|
|
</select>
|
|
<select id="getTeam" resultType="com.bonus.gzrn.rnbmw.person.entity.NoSignalTeamApplyBean">
|
|
SELECT
|
|
bst.id AS id,
|
|
bst.`name` AS name,
|
|
bst.SUB_ID AS subId
|
|
FROM bm_sub_team bst
|
|
WHERE 1 = 1
|
|
<if test="subId!=null and subId!='' and subId != -1 and subId != '-1'">
|
|
AND bst.SUB_ID = #{subId}
|
|
</if>
|
|
<if test="teamId!=null and teamId!='' and teamId != -1 and teamId != '-1'">
|
|
AND bst.ID = #{teamId}
|
|
</if>
|
|
|
|
</select>
|
|
<select id="getNoSignalTeamApplyById"
|
|
resultType="com.bonus.gzrn.rnbmw.person.entity.NoSignalTeamApplyBean">
|
|
SELECT bnst.id AS id,
|
|
bnst.pro_id AS proId,
|
|
bnst.sub_id AS subId,
|
|
bnst.team_id AS teamId,
|
|
bnst.start_time AS startTime,
|
|
bnst.stop_time AS stopTime,
|
|
bnst.file AS file,
|
|
bnst.remark AS remark,
|
|
bnst.examine_status AS examineStatus,
|
|
bnst.upload_id AS uploadId,
|
|
GROUP_CONCAT(bnstf.id) AS fileId,
|
|
GROUP_CONCAT(bnstf.file_path) AS filePath
|
|
FROM bm_no_signal_team bnst
|
|
LEFT JOIN bm_no_signal_team_file bnstf ON bnstf.no_signal_team_id = bnst.id
|
|
|
|
WHERE bnst.is_active = 1
|
|
AND bnst.id = #{id}
|
|
</select>
|
|
|
|
|
|
<select id="getNoSignalTeamApplyListTask" resultType="com.bonus.gzrn.rnbmw.person.entity.NoSignalTeamApplyBean">
|
|
SELECT
|
|
bnst.id AS id,
|
|
bp.ID AS proId,
|
|
bp.`name` AS proName,
|
|
bs.ID AS subId,
|
|
bs.SUB_NAME AS subName,
|
|
bst.ID AS teamId,
|
|
bst.`NAME` AS teamName,
|
|
bnst.start_time AS startTime,
|
|
bnst.stop_time AS stopTime,
|
|
bnst.remark AS remark,
|
|
bnst.examine_status AS examineStatus,
|
|
bnst.examine_opinion AS examineOpinion,
|
|
bnst.upload_id AS uploadId,
|
|
su.USERNAME AS uploadName,
|
|
GROUP_CONCAT(bnstf.file_name) AS fileName,
|
|
GROUP_CONCAT(bnstf.file_path) AS filePath
|
|
|
|
FROM bm_no_signal_team bnst
|
|
LEFT JOIN bm_no_signal_team_file bnstf ON bnstf.no_signal_team_id = bnst.id
|
|
LEFT JOIN bm_project bp ON bp.ID = bnst.pro_id
|
|
LEFT JOIN bm_subcontractor bs ON bs.ID = bnst.sub_id
|
|
LEFT JOIN bm_sub_team bst ON bst.ID = bnst.team_id
|
|
LEFT JOIN sys_user su ON su.ID = bnst.upload_id
|
|
WHERE bnst.is_active = '1'
|
|
and bnst.examine_status = '1'
|
|
</select>
|
|
<update id="updNoSignalTeamApplyTask">
|
|
UPDATE bm_no_signal_team
|
|
SET
|
|
examine_status = #{examineStatus}
|
|
WHERE id = #{id}
|
|
</update>
|
|
</mapper> |