forked from integrated_whb/integrated_whb
179 lines
5.0 KiB
XML
179 lines
5.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.zcloud.mapper.datasource.comprehensive.TrafficSafetyMeetingRecipientMapper">
|
|
<!-- 表名 -->
|
|
<sql id="tableName">
|
|
BUS_TRAFFIC_SAFETY_MEETING_RECIPIENT
|
|
</sql>
|
|
|
|
<!-- 数据字典表名 -->
|
|
<sql id="dicTableName">
|
|
SYS_DICTIONARIES
|
|
</sql>
|
|
|
|
<!-- 字段 -->
|
|
<sql id="Field">
|
|
f.SAFETY_MEETING_RECIPIENT_ID,
|
|
f.SAFETY_MEETING_ID,
|
|
f.AVATAR,
|
|
f.PRACTITIONER,
|
|
f.PRACTITIONER_TYPE,
|
|
f.CONTACT_PHONE,
|
|
f.ATTENDANCE_STATUS,
|
|
f.HOME_ADDRESS,
|
|
f.IDENTITY_NUMBER,
|
|
f.LATITUDE,
|
|
f.LONGITUDE,
|
|
f.ISDELETE,
|
|
f.DELETOR,
|
|
f.DELETORNAME,
|
|
f.DELETETIME,
|
|
f.CREATOR,
|
|
f.CREATORNAME,
|
|
f.CREATETIME,
|
|
f.OPERATOR,
|
|
f.OPERATORNAME,
|
|
f.OPERATTIME,
|
|
f.SIGNATUREPICTURE,
|
|
f.LOCATIONADDRESS,
|
|
f.LIVEPHOTOS
|
|
</sql>
|
|
|
|
<!-- 字段用于新增 -->
|
|
<sql id="Field2">
|
|
SAFETY_MEETING_RECIPIENT_ID,
|
|
SAFETY_MEETING_ID,
|
|
AVATAR,
|
|
PRACTITIONER,
|
|
PRACTITIONER_TYPE,
|
|
CONTACT_PHONE,
|
|
ATTENDANCE_STATUS,
|
|
HOME_ADDRESS,
|
|
IDENTITY_NUMBER,
|
|
LATITUDE,
|
|
LONGITUDE,
|
|
ISDELETE,
|
|
DELETOR,
|
|
DELETORNAME,
|
|
DELETETIME,
|
|
CREATOR,
|
|
CREATORNAME,
|
|
CREATETIME,
|
|
OPERATOR,
|
|
OPERATORNAME,
|
|
OPERATTIME,
|
|
SIGNATUREPICTURE,
|
|
LOCATIONADDRESS,
|
|
LIVEPHOTOS
|
|
</sql>
|
|
|
|
<!-- 字段值 -->
|
|
<sql id="FieldValue">
|
|
#{SAFETY_MEETING_RECIPIENT_ID},
|
|
#{SAFETY_MEETING_ID},
|
|
#{AVATAR},
|
|
#{PRACTITIONER},
|
|
#{PRACTITIONER_TYPE},
|
|
#{CONTACT_PHONE},
|
|
#{ATTENDANCE_STATUS},
|
|
#{HOME_ADDRESS},
|
|
#{IDENTITY_NUMBER},
|
|
#{LATITUDE},
|
|
#{LONGITUDE},
|
|
#{ISDELETE},
|
|
#{DELETOR},
|
|
#{DELETORNAME},
|
|
#{DELETETIME},
|
|
#{CREATOR},
|
|
#{CREATORNAME},
|
|
#{CREATETIME},
|
|
#{OPERATOR},
|
|
#{OPERATORNAME},
|
|
#{OPERATTIME},
|
|
#{SIGNATUREPICTURE},
|
|
#{LOCATIONADDRESS},
|
|
#{LIVEPHOTOS}
|
|
</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"/> f
|
|
set
|
|
f.OPERATOR = #{OPERATOR},
|
|
f.OPERATORNAME = #{OPERATORNAME},
|
|
f.OPERATTIME = #{OPERATTIME},
|
|
f.SIGNATUREPICTURE = #{SIGNATUREPICTURE},
|
|
f.LIVEPHOTOS = #{LIVEPHOTOS},
|
|
f.ATTENDANCE_STATUS = #{ATTENDANCE_STATUS},
|
|
f.LOCATIONADDRESS = #{LOCATIONADDRESS},
|
|
f.LATITUDE = #{LATITUDE},
|
|
f.LONGITUDE = #{LONGITUDE}
|
|
where
|
|
f.SAFETY_MEETING_ID = #{SAFETY_MEETING_ID}
|
|
and f.PRACTITIONER = #{OPERATOR}
|
|
</update>
|
|
<!--移除-->
|
|
<update id="remove">
|
|
update
|
|
<include refid="tableName"/> f
|
|
set
|
|
f.ATTENDANCE_STATUS = #{ATTENDANCE_STATUS}
|
|
where
|
|
f.SAFETY_MEETING_ID = #{SAFETY_MEETING_ID}
|
|
and f.PRACTITIONER = #{PRACTITIONER}
|
|
</update>
|
|
|
|
<!--列表-->
|
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
|
select
|
|
<include refid="Field"></include>,
|
|
u.NAME,
|
|
u.USERNAME
|
|
from
|
|
<include refid="tableName"></include> f
|
|
join sys_user u on f.PRACTITIONER = u.USER_ID
|
|
where f.ISDELETE = '0'
|
|
<if test="pd.PRACTITIONER != null and pd.PRACTITIONER != ''"><!-- 关键词检索-从业人员 -->
|
|
and f.PRACTITIONER = #{pd.PRACTITIONER}
|
|
</if>
|
|
<if test="pd.PRACTITIONER_TYPE != null and pd.PRACTITIONER_TYPE != ''"><!-- 关键词检索-从业类型 -->
|
|
and f.PRACTITIONER_TYPE = #{pd.PRACTITIONER_TYPE}
|
|
</if>
|
|
<if test="pd.ATTENDANCE_STATUS != null and pd.ATTENDANCE_STATUS != ''"><!-- 关键词检索-参会状态 -->
|
|
and f.ATTENDANCE_STATUS = #{pd.ATTENDANCE_STATUS}
|
|
</if>
|
|
<if test="pd.SAFETY_MEETING_ID != null and pd.SAFETY_MEETING_ID != ''">
|
|
and f.SAFETY_MEETING_ID = #{pd.SAFETY_MEETING_ID}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="listForSafetyMeetingRecipient" parameterType="page" resultType="pd">
|
|
select
|
|
f.*,
|
|
u.NAME as NAME,
|
|
u.PHONE as USERNAME,
|
|
u.USERAVATARURL
|
|
from
|
|
<include refid="tableName"></include> f
|
|
left join sys_user u on f.PRACTITIONER = u.USER_ID
|
|
where f.ISDELETE = '0'
|
|
<if test="SAFETY_MEETING_ID != null and SAFETY_MEETING_ID != ''">
|
|
and f.SAFETY_MEETING_ID = #{SAFETY_MEETING_ID}
|
|
</if>
|
|
</select>
|
|
|
|
</mapper>
|