123 lines
6.4 KiB
XML
123 lines
6.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.cpxt.biz.mapper.BizDriverMapper">
|
|
|
|
<resultMap type="BizDriver" id="BizDriverResult">
|
|
<result property="id" column="id" />
|
|
<result property="deptId" column="dept_id" />
|
|
<result property="userId" column="user_id" />
|
|
<result property="name" column="name" />
|
|
<result property="idcard" column="idcard" />
|
|
<result property="gender" column="gender" />
|
|
<result property="phone" column="phone" />
|
|
<result property="photo" column="photo" />
|
|
<result property="idcardPhotoFace" column="idcard_photo_face" />
|
|
<result property="idcardPhotoNe" column="idcard_photo_ne" />
|
|
<result property="defaultCarId" column="default_car_id" />
|
|
<result property="defaultCarNo" column="default_car_no" />
|
|
<result property="status" column="status" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBizDriverVo">
|
|
select id, dept_id, user_id, name, idcard, gender, phone, photo, idcard_photo_face, idcard_photo_ne, default_car_id, default_car_no, status, create_time, update_time, remark from biz_driver
|
|
</sql>
|
|
|
|
<select id="selectBizDriverList" parameterType="BizDriver" resultMap="BizDriverResult">
|
|
<include refid="selectBizDriverVo"/>
|
|
<where>
|
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
<if test="idcard != null and idcard != ''"> and idcard = #{idcard}</if>
|
|
<if test="gender != null and gender != ''"> and gender = #{gender}</if>
|
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
<if test="photo != null and photo != ''"> and photo = #{photo}</if>
|
|
<if test="idcardPhotoFace != null and idcardPhotoFace != ''"> and idcard_photo_face = #{idcardPhotoFace}</if>
|
|
<if test="idcardPhotoNe != null and idcardPhotoNe != ''"> and idcard_photo_ne = #{idcardPhotoNe}</if>
|
|
<if test="defaultCarId != null "> and default_car_id = #{defaultCarId}</if>
|
|
<if test="defaultCarNo != null and defaultCarNo != ''"> and default_car_no = #{defaultCarNo}</if>
|
|
<if test="status != null "> and status = #{status}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectBizDriverById" parameterType="Long" resultMap="BizDriverResult">
|
|
<include refid="selectBizDriverVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertBizDriver" parameterType="BizDriver" useGeneratedKeys="true" keyProperty="id">
|
|
insert into biz_driver
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="deptId != null">dept_id,</if>
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="name != null">name,</if>
|
|
<if test="idcard != null">idcard,</if>
|
|
<if test="gender != null">gender,</if>
|
|
<if test="phone != null">phone,</if>
|
|
<if test="photo != null">photo,</if>
|
|
<if test="idcardPhotoFace != null">idcard_photo_face,</if>
|
|
<if test="idcardPhotoNe != null">idcard_photo_ne,</if>
|
|
<if test="defaultCarId != null">default_car_id,</if>
|
|
<if test="defaultCarNo != null">default_car_no,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="remark != null">remark,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="deptId != null">#{deptId},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="name != null">#{name},</if>
|
|
<if test="idcard != null">#{idcard},</if>
|
|
<if test="gender != null">#{gender},</if>
|
|
<if test="phone != null">#{phone},</if>
|
|
<if test="photo != null">#{photo},</if>
|
|
<if test="idcardPhotoFace != null">#{idcardPhotoFace},</if>
|
|
<if test="idcardPhotoNe != null">#{idcardPhotoNe},</if>
|
|
<if test="defaultCarId != null">#{defaultCarId},</if>
|
|
<if test="defaultCarNo != null">#{defaultCarNo},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBizDriver" parameterType="BizDriver">
|
|
update biz_driver
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
<if test="name != null">name = #{name},</if>
|
|
<if test="idcard != null">idcard = #{idcard},</if>
|
|
<if test="gender != null">gender = #{gender},</if>
|
|
<if test="phone != null">phone = #{phone},</if>
|
|
<if test="photo != null">photo = #{photo},</if>
|
|
<if test="idcardPhotoFace != null">idcard_photo_face = #{idcardPhotoFace},</if>
|
|
<if test="idcardPhotoNe != null">idcard_photo_ne = #{idcardPhotoNe},</if>
|
|
<if test="defaultCarId != null">default_car_id = #{defaultCarId},</if>
|
|
<if test="defaultCarNo != null">default_car_no = #{defaultCarNo},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteBizDriverById" parameterType="Long">
|
|
delete from biz_driver where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteBizDriverByIds" parameterType="String">
|
|
delete from biz_driver where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |