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

82 lines
3.0 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.SjEfficiencyMapper">
<insert id="addData">
insert into sj_efficiency_analysis(
create_time,weather
)values (#{createTime},#{weather})
</insert>
<update id="updateData">
update sj_efficiency_analysis set create_time=#{createTime},weather=#{weather}
where id=#{id}
</update>
<delete id="delete">
delete from sj_efficiency_analysis where id=#{id}
</delete>
<select id="getList" resultType="com.securitycontrol.entity.background.vo.SjEfficiencyVo">
select id, create_time createTime,weather
from sj_efficiency_analysis
<where>
<if test="weather!=null and weather!=''">
weather like concat('%',#{weather},'%')
</if>
<if test="createTime!=null and createTime!=''">
and create_time =#{createTime}
</if>
</where>
</select>
<select id="getDetails" resultType="com.securitycontrol.entity.background.vo.SjEfficiencyVo">
select id, create_time createTime,weather
from sj_efficiency_analysis
where id=#{id}
</select>
<select id="getNewList" resultType="com.securitycontrol.entity.background.vo.SjNewZylllWarnVo">
select id, tx_time txTime, content, create_time createTime,
remark,project_id bidCode, pro_name proName
from sj_new_benefit_analysis sjw
left join tb_project tp on sjw.project_id=tp.bid_code
<where>
data_type = '整体效能分析'
<if test="keyWord!=null and keyWord!=''">
and (tx_time =#{keyWord} or
content like concat('%',#{keyWord},'%')
)
</if>
</where>
</select>
<insert id="addNewData">
insert into sj_new_benefit_analysis(tx_time,content,data_type,create_time,project_id)
values(#{txTime},#{content},#{dataType},now(),#{bidCode})
</insert>
<update id="updateNewData">
update sj_new_benefit_analysis
<set>
<if test="txTime!=null and txTime!=''">
tx_time= #{txTime},
</if>
<if test="content!=null and content!=''">
content= #{content},
</if>
</set>
where id= #{id}
</update>
<select id="getNewDetails" resultType="com.securitycontrol.entity.background.vo.SjNewZylllWarnVo">
select id, tx_time txTime, content, create_time createTime,
remark,project_id bidCode, pro_name proName
from sj_new_benefit_analysis sjw
left join tb_project tp on sjw.project_id=tp.bid_code
where id= #{id}
</select>
<delete id="deleteNewData">
delete from sj_new_benefit_analysis where id=#{id}
</delete>
</mapper>