ah_jjzhgd_service/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/SjProjectQualityMapper.xml

151 lines
6.9 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.securitycontrol.background.mapper.SjProjectQualityMapper">
<!--新增数据-->
<insert id="addData">
insert into sj_project_quality(
pro_type,pro_structure,total_item,
accept_item,accept_table,accept_qualified_table,
accept_rate,accept_tb_rate,main_accept_num,
main_one_accept_num,main_accept_rate,comm_accept,
comm_one_accept,comm_accept_rate
)values (#{proType},#{proStructure},#{totalItem},#{acceptItem},#{acceptTable},#{acceptQualifiedTable},
#{acceptRate},#{acceptTbRate},#{mainAcceptNum},#{mainOneAcceptNum},#{mainAcceptRate},#{commAccept},
#{commOneAccept},#{commAcceptRate}
)
</insert>
<insert id="newAddData">
insert into sj_new_project_quality(
team_name,content,test_day,
test_result,test_report,create_time,project_id
)values (#{teamId},#{content},#{testDay},#{testResult},#{testReport},now(),#{bidCode})
</insert>
<insert id="newUpdateData">
update sj_new_project_quality set team_name=#{teamId},content=#{content},
test_day=#{testDay},test_result=#{testResult},
test_report=#{testReport},
project_id=#{bidCode}
where id=#{id}
</insert>
<insert id="addWarnData">
insert into sj_new_async_warn(
tx_time, tx_type, content, data_type, remark, create_time, project_id
)values (#{txTime},#{txType},#{content},#{dataType},#{remark},now(),#{bidCode})
</insert>
<delete id="newDelete">
delete from sj_new_project_quality where id=#{id}
</delete>
<!--修改质量数据-->
<update id="updateData">
update sj_project_quality set pro_type=#{proType},pro_structure=#{proStructure},total_item=#{totalItem},
accept_item=#{acceptItem},accept_table=#{acceptTable},accept_qualified_table=#{acceptQualifiedTable},
accept_rate=#{acceptRate},accept_tb_rate=#{acceptTbRate},main_accept_num=#{mainAcceptRate},
main_one_accept_num=#{mainOneAcceptNum},main_accept_rate=#{mainAcceptRate},comm_accept=#{commAccept},
comm_one_accept=#{commOneAccept},comm_accept_rate=#{commAcceptRate}
where id=#{id}
</update>
<update id="updateWarnData">
update sj_new_async_warn set
tx_time=#{txTime}, tx_type=#{txType}, content=#{content}, data_type=#{dataType},
remark=#{remark}, create_time=now(), project_id=#{bidCode}
where id=#{id}
</update>
<delete id="delete">
delete from sj_new_project_quality where id=#{id}
</delete>
<delete id="deleteWarnData">
delete from sj_new_async_warn where id=#{id}
</delete>
<!-- -->
<select id="getList" resultType="com.securitycontrol.entity.background.vo.SjProjectQualityVo">
select id, pro_type proType,
pro_structure proStructure,
total_item totalItem,
accept_item acceptItem,
accept_table acceptTable,
accept_qualified_table acceptQualifiedTable,
accept_rate acceptRate,
accept_tb_rate acceptTbRate,
main_accept_num mainAcceptNum,
main_one_accept_num mainOneAcceptNum,
main_accept_rate mainAcceptRate,
comm_accept commAccept ,
comm_one_accept commOneAccept,
comm_accept_rate commAcceptRate
from sj_project_quality
<where>
<if test="proType!=null and proType!=''">
pro_type like concat('%',#{proType},'%')
</if>
<if test="proStructure!=null and proStructure!=''">
pro_structure like concat('%',#{proStructure},'%')
</if>
</where>
</select>
<select id="getDetails" resultType="com.securitycontrol.entity.background.vo.SjProjectQualityVo">
select id, pro_type proType,
pro_structure proStructure,
total_item totalItem,
accept_item acceptItem,
accept_table acceptTable,
accept_qualified_table acceptQualifiedTable,
accept_rate acceptRate,
accept_tb_rate acceptTbRate,
main_accept_num mainAcceptNum,
main_one_accept_num mainOneAcceptNum,
main_accept_rate mainAcceptRate,
comm_accept commAccept ,
comm_one_accept commOneAccept,
comm_accept_rate commAcceptRate
from sj_project_quality
where id=#{id}
</select>
<select id="getNewList" resultType="com.securitycontrol.entity.background.vo.SjProjectMassVo">
select sjq.id,
sjq.project_id as bidCode,
tp.pro_name proName,
team.id teamId ,
team.team_name teamName,
sjq.content as content,
sjq.test_day testDay,
sjq.test_result testResult,
sjq.test_report testReport
from sj_new_project_quality sjq
left join tb_project tp on sjq.project_id=tp.bid_code
LEFT JOIN sj_work_team team on team.id=sjq.team_name
<where>
<if test="keyWord!=null and keyWord!=''">
(team.team_name like concat('%',#{keyWord},'%')
or sjq.content like concat('%',#{keyWord},'%')
or sjq.test_result like concat('%',#{keyWord},'%'))
</if>
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
and DATE(sjq.test_day) BETWEEN DATE(#{startDate}) and DATE(#{endDate})
</if>
</where>
</select>
<select id="getNewDetails" resultType="com.securitycontrol.entity.background.vo.SjProjectMassVo">
select sjq.id,
sjq.project_id as bidCode,
tp.pro_name proName,
team.id teamId ,
team.team_name,
sjq.content as content,
sjq.test_day testDay,
sjq.test_result testResult,
sjq.test_report testReport
from sj_new_project_quality sjq
left join tb_project tp on sjq.project_id=tp.bid_code
LEFT JOIN sj_work_team team on team.id=sjq.team_name
where sjq.id=#{id}
</select>
<select id="getWarnList" resultType="com.securitycontrol.entity.background.vo.SjNewAsyncWarnVo">
select warn.id,warn.tx_time txTime,warn.tx_type txType,warn.content content,
warn.remark,warn.create_time createTime,warn.project_id bidCode,tp.pro_name proName
FROM sj_new_async_warn warn
left join tb_project tp on warn.project_id=tp.bid_code
where warn.data_type='1'
</select>
</mapper>