integrated_traffic/src/main/resources/mybatis/datasource/comprehensive/TrafficSafetyResponsibility...

138 lines
3.5 KiB
XML
Raw Normal View History

<?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.zcloud.mapper.datasource.comprehensive.TrafficSafetyResponsibilityMapper">
<!-- 表名 -->
<sql id="tableName">
BUS_TRAFFIC_SAFETY_RESPONSIBILITY
</sql>
<!-- 数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.SAFETYRESPONSIBILITY_ID,
f.RESPONSIBILITYNAME,
f.COMPLETIONSTATUS,
f.VALIDSTATUS,
f.ISSIGNED,
f.OPERATINGCOMPANY,
f.EXPIRYDATE,
f.ATTACHMENT_ROUTE,
f.USER_ID,
f.ISDELETE,
f.DELETOR,
f.DELETORNAME,
f.DELETETIME,
f.CREATOR,
f.CREATORNAME,
f.CREATETIME,
f.OPERATOR,
f.OPERATORNAME,
f.OPERATTIME
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
SAFETYRESPONSIBILITY_ID,
RESPONSIBILITYNAME,
COMPLETIONSTATUS,
VALIDSTATUS,
ISSIGNED,
OPERATINGCOMPANY,
EXPIRYDATE,
ATTACHMENT_ROUTE,
USER_ID,
ISDELETE,
DELETOR,
DELETORNAME,
DELETETIME,
CREATOR,
CREATORNAME,
CREATETIME,
OPERATOR,
OPERATORNAME,
OPERATTIME
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{SAFETYRESPONSIBILITY_ID},
#{RESPONSIBILITYNAME},
#{COMPLETIONSTATUS},
#{VALIDSTATUS},
#{ISSIGNED},
#{OPERATINGCOMPANY},
#{EXPIRYDATE},
#{ATTACHMENT_ROUTE},
#{USER_ID},
#{ISDELETE},
#{DELETOR},
#{DELETORNAME},
#{DELETETIME},
#{CREATOR},
#{CREATORNAME},
#{CREATETIME},
#{OPERATOR},
#{OPERATORNAME},
#{OPERATTIME}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
OPERATOR = #{OPERATOR},
OPERATORNAME = #{OPERATORNAME},
OPERATTIME = #{OPERATTIME},
ATTACHMENT_ROUTE=#{ATTACHMENT_ROUTE}
where
SAFETYRESPONSIBILITY_ID = #{SAFETYRESPONSIBILITY_ID}
</update>
<!--列表-->
<select id="datalistPage" parameterType="page" resultType="pd">
select
u.NAME,
u.USER_ID,
i.CORP_NAME,
c.RESPONSIBILITYNAME,
c.COMPLETIONSTATUS,
c.VALIDSTATUS,
c.EXPIRYDATE,
c.CREATETIME,
c.OPERATTIME,
c.SAFETYRESPONSIBILITY_ID,
c.ISSIGNED
from
sys_user u
left join bus_corp_info i on u.CORPINFO_ID = i.CORPINFO_ID
left join BUS_TRAFFIC_SAFETY_RESPONSIBILITY c on u.USER_ID = c.USER_ID
where u.ISDELETE = '0'
and u.ISMAIN != '1'
</select>
<select id="findById" resultType="com.zcloud.entity.PageData" parameterType="com.zcloud.entity.PageData">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.SAFETYRESPONSIBILITY_ID = #{SAFETYRESPONSIBILITY_ID}
</select>
</mapper>