249 lines
9.4 KiB
XML
249 lines
9.4 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.zhwl.travelagency.guide.mapper.ZdyTravelAgencyGuideMapper">
|
||
|
|
||
|
<resultMap type="ZdyTravelAgencyGuide" id="ZdyTravelAgencyGuideResult">
|
||
|
<result property="id" column="id"/>
|
||
|
<result property="travelAgencyId" column="travel_agency_id"/>
|
||
|
<result property="name" column="name"/>
|
||
|
<result property="gender" column="gender"/>
|
||
|
<result property="phone" column="phone"/>
|
||
|
<result property="idCard" column="id_card"/>
|
||
|
<result property="grade" column="grade"/>
|
||
|
<result property="tourGuideIdNumber" column="tour_guide_id_number"/>
|
||
|
<result property="certificatesStatTime" column="certificates_stat_time"/>
|
||
|
<result property="certificatesEndTime" column="certificates_end_time"/>
|
||
|
<result property="delFlag" column="del_flag"/>
|
||
|
<result property="createBy" column="create_by"/>
|
||
|
<result property="createTime" column="create_time"/>
|
||
|
<result property="updateBy" column="update_by"/>
|
||
|
<result property="updateTime" column="update_time"/>
|
||
|
<result property="remark" column="remark"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectZdyTravelAgencyGuideVo">
|
||
|
select g.id,
|
||
|
g.travel_agency_id,
|
||
|
g.name,
|
||
|
g.gender,
|
||
|
g.phone,
|
||
|
g.id_card,
|
||
|
g.grade,
|
||
|
g.tour_guide_id_number,
|
||
|
g.certificates_stat_time,
|
||
|
g.certificates_end_time,
|
||
|
g.del_flag,
|
||
|
g.create_by,
|
||
|
g.create_time,
|
||
|
g.update_by,
|
||
|
g.update_time,
|
||
|
g.remark
|
||
|
from zdy_travel_agency_guide g left join zdy_travel_agency_info i on g.travel_agency_id=i.id
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectZdyTravelAgencyGuideList" parameterType="ZdyTravelAgencyGuide"
|
||
|
resultMap="ZdyTravelAgencyGuideResult">
|
||
|
<include refid="selectZdyTravelAgencyGuideVo"/>
|
||
|
<where>
|
||
|
g.del_flag = '0'
|
||
|
<if test="name != null and name != ''">
|
||
|
and g.name like concat('%', #{name}, '%')
|
||
|
</if>
|
||
|
<if test="travelAgencyId != null and travelAgencyId != ''">
|
||
|
and g.travel_agency_id = #{travelAgencyId}
|
||
|
</if>
|
||
|
<if test="gender != null ">
|
||
|
and g.gender = #{gender}
|
||
|
</if>
|
||
|
<if test="phone != null and phone != ''">
|
||
|
and g.phone = #{phone}
|
||
|
</if>
|
||
|
<if test="idCard != null and idCard != ''">
|
||
|
and g.id_card = #{idCard}
|
||
|
</if>
|
||
|
<if test="grade != null ">
|
||
|
and g.grade = #{grade}
|
||
|
</if>
|
||
|
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">
|
||
|
and g.tour_guide_id_number = #{tourGuideIdNumber}
|
||
|
</if>
|
||
|
<if test="certificatesStatTime != null ">
|
||
|
and g.certificates_stat_time = #{certificatesStatTime}
|
||
|
</if>
|
||
|
<if test="certificatesEndTime != null ">
|
||
|
and g.certificates_end_time = #{certificatesEndTime}
|
||
|
</if>
|
||
|
${params.dataScope}
|
||
|
</where>
|
||
|
order by g.create_time desc
|
||
|
</select>
|
||
|
|
||
|
<select id="selectZdyTravelAgencyGuideById" parameterType="Long"
|
||
|
resultMap="ZdyTravelAgencyGuideResult">
|
||
|
<include refid="selectZdyTravelAgencyGuideVo"/>
|
||
|
where g.id = #{id} and g.del_flag='0'
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertZdyTravelAgencyGuide" parameterType="ZdyTravelAgencyGuide" useGeneratedKeys="true"
|
||
|
keyProperty="id">
|
||
|
insert into zdy_travel_agency_guide
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null and name != ''">name,
|
||
|
</if>
|
||
|
<if test="travelAgencyId != null and travelAgencyId != ''">travel_agency_id,
|
||
|
</if>
|
||
|
<if test="gender != null">gender,
|
||
|
</if>
|
||
|
<if test="phone != null">phone,
|
||
|
</if>
|
||
|
<if test="idCard != null">id_card,
|
||
|
</if>
|
||
|
<if test="grade != null">grade,
|
||
|
</if>
|
||
|
<if test="tourGuideIdNumber != null">tour_guide_id_number,
|
||
|
</if>
|
||
|
<if test="certificatesStatTime != null">certificates_stat_time,
|
||
|
</if>
|
||
|
<if test="certificatesEndTime != null">certificates_end_time,
|
||
|
</if>
|
||
|
<if test="delFlag != null">del_flag,
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by,
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time,
|
||
|
</if>
|
||
|
<if test="updateBy != null">update_by,
|
||
|
</if>
|
||
|
<if test="updateTime != null">update_time,
|
||
|
</if>
|
||
|
<if test="remark != null">remark,
|
||
|
</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null and name != ''">#{name},
|
||
|
</if>
|
||
|
<if test="travelAgencyId != null and travelAgencyId != ''">#{travelAgencyId},
|
||
|
</if>
|
||
|
<if test="gender != null">#{gender},
|
||
|
</if>
|
||
|
<if test="phone != null">#{phone},
|
||
|
</if>
|
||
|
<if test="idCard != null">#{idCard},
|
||
|
</if>
|
||
|
<if test="grade != null">#{grade},
|
||
|
</if>
|
||
|
<if test="tourGuideIdNumber != null">#{tourGuideIdNumber},
|
||
|
</if>
|
||
|
<if test="certificatesStatTime != null">#{certificatesStatTime},
|
||
|
</if>
|
||
|
<if test="certificatesEndTime != null">#{certificatesEndTime},
|
||
|
</if>
|
||
|
<if test="delFlag != null">#{delFlag},
|
||
|
</if>
|
||
|
<if test="createBy != null">#{createBy},
|
||
|
</if>
|
||
|
<if test="createTime != null">#{createTime},
|
||
|
</if>
|
||
|
<if test="updateBy != null">#{updateBy},
|
||
|
</if>
|
||
|
<if test="updateTime != null">#{updateTime},
|
||
|
</if>
|
||
|
<if test="remark != null">#{remark},
|
||
|
</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateZdyTravelAgencyGuide" parameterType="ZdyTravelAgencyGuide">
|
||
|
update zdy_travel_agency_guide
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="name != null and name != ''">name =
|
||
|
#{name},
|
||
|
</if>
|
||
|
<if test="travelAgencyId != null and travelAgencyId != ''">travel_agency_id =
|
||
|
#{travelAgencyId},
|
||
|
</if>
|
||
|
<if test="gender != null">gender =
|
||
|
#{gender},
|
||
|
</if>
|
||
|
<if test="phone != null">phone =
|
||
|
#{phone},
|
||
|
</if>
|
||
|
<if test="idCard != null">id_card =
|
||
|
#{idCard},
|
||
|
</if>
|
||
|
<if test="grade != null">grade =
|
||
|
#{grade},
|
||
|
</if>
|
||
|
<if test="tourGuideIdNumber != null">tour_guide_id_number =
|
||
|
#{tourGuideIdNumber},
|
||
|
</if>
|
||
|
<if test="certificatesStatTime != null">certificates_stat_time =
|
||
|
#{certificatesStatTime},
|
||
|
</if>
|
||
|
<if test="certificatesEndTime != null">certificates_end_time =
|
||
|
#{certificatesEndTime},
|
||
|
</if>
|
||
|
<if test="delFlag != null">del_flag =
|
||
|
#{delFlag},
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by =
|
||
|
#{createBy},
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time =
|
||
|
#{createTime},
|
||
|
</if>
|
||
|
<if test="updateBy != null">update_by =
|
||
|
#{updateBy},
|
||
|
</if>
|
||
|
<if test="updateTime != null">update_time =
|
||
|
#{updateTime},
|
||
|
</if>
|
||
|
<if test="remark != null">remark =
|
||
|
#{remark},
|
||
|
</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteZdyTravelAgencyGuideById" parameterType="Long">
|
||
|
update zdy_travel_agency_guide
|
||
|
set del_flag='1'
|
||
|
where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteZdyTravelAgencyGuideByIds" parameterType="String">
|
||
|
update zdy_travel_agency_guide set del_flag='1' where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
<select id="checkPhoneUnique" parameterType="string" resultMap="ZdyTravelAgencyGuideResult">
|
||
|
select id, phone
|
||
|
from zdy_travel_agency_guide
|
||
|
where phone = #{phone}
|
||
|
and del_flag = '0' limit 1
|
||
|
</select>
|
||
|
|
||
|
<select id="checkIdCardUnique" parameterType="string" resultMap="ZdyTravelAgencyGuideResult">
|
||
|
select id, id_card
|
||
|
from zdy_travel_agency_guide
|
||
|
where id_card = #{idCard}
|
||
|
and del_flag = '0' limit 1
|
||
|
</select>
|
||
|
|
||
|
<select id="checkTourGuideIdNumberUnique" parameterType="string" resultMap="ZdyTravelAgencyGuideResult">
|
||
|
select id, tour_guide_id_number
|
||
|
from zdy_travel_agency_guide
|
||
|
where tour_guide_id_number = #{tourGuideIdNumber}
|
||
|
and del_flag = '0' limit 1
|
||
|
</select>
|
||
|
|
||
|
<select id="selectZdyTravelAgencyGuideListByTravelAgencyId" parameterType="long" resultMap="ZdyTravelAgencyGuideResult">
|
||
|
<include refid="selectZdyTravelAgencyGuideVo"/>
|
||
|
where g.del_flag='0'
|
||
|
and g.travel_agency_id = #{travelAgencyId}
|
||
|
</select>
|
||
|
</mapper>
|