|
@@ -1,128 +1,129 @@
|
|
|
<?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">
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<!-- namespace必须指向DAO接口 -->
|
|
|
<mapper namespace="com.jpsoft.bus.modules.bus.dao.DriverInfoDAO">
|
|
|
- <resultMap id="DriverInfoMap" type="com.jpsoft.bus.modules.bus.entity.DriverInfo">
|
|
|
- <id property="id" column="id_" />
|
|
|
- <result property="companyId" column="company_id" />
|
|
|
- <result property="name" column="name_" />
|
|
|
- <result property="idCard" column="id_card" />
|
|
|
- <result property="phone" column="phone_" />
|
|
|
- <result property="faceImage" column="face_image" />
|
|
|
- <result property="remark" column="remark_" />
|
|
|
- <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="delFlag" column="del_flag" />
|
|
|
- </resultMap>
|
|
|
- <insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.DriverInfo">
|
|
|
- <!--
|
|
|
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
- select sys_guid() from dual
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
- <![CDATA[
|
|
|
+ <resultMap id="DriverInfoMap" type="com.jpsoft.bus.modules.bus.entity.DriverInfo">
|
|
|
+ <id property="id" column="id_"/>
|
|
|
+ <result property="companyId" column="company_id"/>
|
|
|
+ <result property="name" column="name_"/>
|
|
|
+ <result property="idCard" column="id_card"/>
|
|
|
+ <result property="phone" column="phone_"/>
|
|
|
+ <result property="faceImage" column="face_image"/>
|
|
|
+ <result property="remark" column="remark_"/>
|
|
|
+ <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="delFlag" column="del_flag"/>
|
|
|
+ </resultMap>
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.DriverInfo">
|
|
|
+ <!--
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
+ select sys_guid() from dual
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ <![CDATA[
|
|
|
insert into bus_driver_info
|
|
|
(company_id,name_,id_card,phone_,face_image,remark_,create_by,create_time,update_by,update_time,del_flag)
|
|
|
values
|
|
|
(
|
|
|
-#{companyId,jdbcType=VARCHAR}
|
|
|
-,#{name,jdbcType=VARCHAR}
|
|
|
-,#{idCard,jdbcType=VARCHAR}
|
|
|
-,#{phone,jdbcType=VARCHAR}
|
|
|
-,#{faceImage,jdbcType=VARCHAR}
|
|
|
-,#{remark,jdbcType=VARCHAR}
|
|
|
-,#{createBy,jdbcType=VARCHAR}
|
|
|
-,#{createTime,jdbcType= TIMESTAMP }
|
|
|
-,#{updateBy,jdbcType=VARCHAR}
|
|
|
-,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
-,#{delFlag,jdbcType= NUMERIC }
|
|
|
+ #{companyId,jdbcType=VARCHAR}
|
|
|
+ ,#{name,jdbcType=VARCHAR}
|
|
|
+ ,#{idCard,jdbcType=VARCHAR}
|
|
|
+ ,#{phone,jdbcType=VARCHAR}
|
|
|
+ ,#{faceImage,jdbcType=VARCHAR}
|
|
|
+ ,#{remark,jdbcType=VARCHAR}
|
|
|
+ ,#{createBy,jdbcType=VARCHAR}
|
|
|
+ ,#{createTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{updateBy,jdbcType=VARCHAR}
|
|
|
+ ,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{delFlag,jdbcType= NUMERIC }
|
|
|
)
|
|
|
]]>
|
|
|
- </insert>
|
|
|
- <delete id="delete" parameterType="string">
|
|
|
- delete from bus_driver_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
- <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.DriverInfo">
|
|
|
- update bus_driver_info
|
|
|
- <set>
|
|
|
- <if test="companyId!=null">
|
|
|
- company_id=#{companyId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="name!=null">
|
|
|
- name_=#{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="idCard!=null">
|
|
|
- id_card=#{idCard,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="phone!=null">
|
|
|
- phone_=#{phone,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="faceImage!=null">
|
|
|
- face_image=#{faceImage,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="remark!=null">
|
|
|
- remark_=#{remark,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createBy!=null">
|
|
|
- create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime!=null">
|
|
|
- create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
- </if>
|
|
|
- <if test="updateBy!=null">
|
|
|
- update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="updateTime!=null">
|
|
|
- update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
- </if>
|
|
|
- <if test="delFlag!=null">
|
|
|
- del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id_=#{id}
|
|
|
- </update>
|
|
|
- <select id="get" parameterType="string" resultMap="DriverInfoMap">
|
|
|
- select
|
|
|
-id_,company_id,name_,id_card,phone_,face_image,remark_,create_by,create_time,update_by,update_time,del_flag from bus_driver_info where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="exist" parameterType="string" resultType="int">
|
|
|
- select count(*) from bus_driver_info where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="list" resultMap="DriverInfoMap">
|
|
|
- select * from bus_driver_info
|
|
|
- </select>
|
|
|
- <select id="search" parameterType="hashmap" resultMap="DriverInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ </insert>
|
|
|
+ <delete id="delete" parameterType="long">
|
|
|
+ delete from bus_driver_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.DriverInfo">
|
|
|
+ update bus_driver_info
|
|
|
+ <set>
|
|
|
+ <if test="companyId!=null">
|
|
|
+ company_id=#{companyId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="name!=null">
|
|
|
+ name_=#{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="idCard!=null">
|
|
|
+ id_card=#{idCard,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="phone!=null">
|
|
|
+ phone_=#{phone,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="faceImage!=null">
|
|
|
+ face_image=#{faceImage,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remark!=null">
|
|
|
+ remark_=#{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createBy!=null">
|
|
|
+ create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null">
|
|
|
+ create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="updateBy!=null">
|
|
|
+ update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime!=null">
|
|
|
+ update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!=null">
|
|
|
+ del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_=#{id}
|
|
|
+ </update>
|
|
|
+ <select id="get" parameterType="long" resultMap="DriverInfoMap">
|
|
|
+ select
|
|
|
+ id_,company_id,name_,id_card,phone_,face_image,remark_,create_by,create_time,update_by,update_time,del_flag from
|
|
|
+ bus_driver_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="exist" parameterType="long" resultType="int">
|
|
|
+ select count(*) from bus_driver_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="list" resultMap="DriverInfoMap">
|
|
|
+ select * from bus_driver_info
|
|
|
+ </select>
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="DriverInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_driver_info
|
|
|
]]>
|
|
|
- <where>
|
|
|
- del_flag = false
|
|
|
- <if test="searchParams.companyId != null">
|
|
|
- and company_id = #{searchParams.companyId}
|
|
|
- </if>
|
|
|
- <if test="searchParams.name != null">
|
|
|
- and name_ like #{searchParams.name}
|
|
|
- </if>
|
|
|
- <if test="searchParams.idCard != null">
|
|
|
- and id_card like #{searchParams.idCard}
|
|
|
- </if>
|
|
|
- <if test="searchParams.phone != null">
|
|
|
- and phone_ like #{searchParams.phone}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
- ${sort.name} ${sort.order}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
- <select id="findByPhone" resultMap="DriverInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ <where>
|
|
|
+ del_flag = false
|
|
|
+ <if test="searchParams.companyId != null">
|
|
|
+ and company_id = #{searchParams.companyId}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.name != null">
|
|
|
+ and name_ like #{searchParams.name}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.idCard != null">
|
|
|
+ and id_card like #{searchParams.idCard}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.phone != null">
|
|
|
+ and phone_ like #{searchParams.phone}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+ <select id="findByPhone" resultMap="DriverInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_driver_info
|
|
|
where del_flag = 0
|
|
|
and phone_ = #{phone}
|
|
|
limit 1
|
|
|
]]>
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
</mapper>
|