njzscloud-dispose/njzscloud-svr/src/main/resources/mapper/cst/driver/DriverMapper.xml

103 lines
4.8 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.njzscloud.dispose.cst.driver.mapper.DriverMapper">
<resultMap id="DriverResultMap" type="com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="customer_id" property="customerId"/>
<result column="org_id" property="orgId"/>
<result column="driving_licence_no" property="drivingLicenceNo"/>
<result column="driver_name" property="driverName"/>
<result column="phone" property="phone"/>
<result column="driving_licence" property="drivingLicence"/>
<result column="licence_start_time" property="licenceStartTime"/>
<result column="licence_end_time" property="licenceEndTime"/>
<result column="busy" property="busy"/>
<result column="creator_id" property="creatorId"/>
<result column="modifier_id" property="modifierId"/>
<result column="create_time" property="createTime"/>
<result column="modify_time" property="modifyTime"/>
<result column="deleted" property="deleted"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, customer_id, org_id, driving_licence_no, driver_name, phone,
driving_licence, licence_start_time, licence_end_time, busy,
creator_id, modifier_id, create_time, modify_time, deleted
</sql>
<select id="selectById" resultMap="DriverResultMap">
SELECT <include refid="Base_Column_List"/>
FROM cst_driver
WHERE id = #{id}
</select>
<select id="selectList" resultMap="DriverResultMap">
SELECT <include refid="Base_Column_List"/>
FROM cst_driver
<where>
<if test="userId != null">AND user_id = #{userId}</if>
<if test="customerId != null">AND customer_id = #{customerId}</if>
<if test="orgId != null">AND org_id = #{orgId}</if>
<if test="driverName != null and driverName != ''">AND driver_name = #{driverName}</if>
<if test="phone != null and phone != ''">AND phone = #{phone}</if>
<if test="busy != null">AND busy = #{busy}</if>
<if test="deleted != null">AND deleted = #{deleted}</if>
</where>
ORDER BY create_time DESC
</select>
</mapper>
<?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.njzscloud.dispose.cst.driver.mapper.DriverMapper">
<resultMap id="DriverResultMap" type="com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="customer_id" property="customerId"/>
<result column="org_id" property="orgId"/>
<result column="driving_licence_no" property="drivingLicenceNo"/>
<result column="driver_name" property="driverName"/>
<result column="phone" property="phone"/>
<result column="driving_licence" property="drivingLicence"/>
<result column="licence_start_time" property="licenceStartTime"/>
<result column="licence_end_time" property="licenceEndTime"/>
<result column="busy" property="busy"/>
<result column="creator_id" property="creatorId"/>
<result column="modifier_id" property="modifierId"/>
<result column="create_time" property="createTime"/>
<result column="modify_time" property="modifyTime"/>
<result column="deleted" property="deleted"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, customer_id, org_id, driving_licence_no, driver_name, phone, driving_licence,
licence_start_time, licence_end_time, busy, creator_id, modifier_id, create_time, modify_time, deleted
</sql>
<select id="selectById" resultMap="DriverResultMap">
SELECT <include refid="Base_Column_List"/>
FROM cst_driver
WHERE id = #{id}
</select>
<select id="selectList" resultMap="DriverResultMap">
SELECT <include refid="Base_Column_List"/>
FROM cst_driver
<where>
<if test="userId != null">AND user_id = #{userId}</if>
<if test="customerId != null">AND customer_id = #{customerId}</if>
<if test="orgId != null">AND org_id = #{orgId}</if>
<if test="driverName != null and driverName != ''">AND driver_name = #{driverName}</if>
<if test="phone != null and phone != ''">AND phone = #{phone}</if>
<if test="busy != null">AND busy = #{busy}</if>
<if test="deleted != null">AND deleted = #{deleted}</if>
</where>
ORDER BY create_time DESC
</select>
</mapper>