|
@@ -14,6 +14,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="status" column="status" />
|
|
<result property="status" column="status" />
|
|
|
<result property="lastRunTime" column="last_run_time" />
|
|
<result property="lastRunTime" column="last_run_time" />
|
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
+ <result property="deptId" column="dept_id" />
|
|
|
|
|
+ <result property="deptName" column="dept_name" />
|
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createBy" column="create_by" />
|
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateBy" column="update_by" />
|
|
@@ -22,38 +24,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectTsbDeviceVo">
|
|
<sql id="selectTsbDeviceVo">
|
|
|
- select device_id, imei, device_type, device_sn, device_produce_date, software_version,
|
|
|
|
|
|
|
+ select device_id, imei, device_type, device_sn, dept_id, device_produce_date, software_version,
|
|
|
status, last_run_time, del_flag, create_by, create_time, update_by, update_time, remark
|
|
status, last_run_time, del_flag, create_by, create_time, update_by, update_time, remark
|
|
|
from tsb_device
|
|
from tsb_device
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectTsbDeviceList" parameterType="TsbDevice" resultMap="TsbDeviceResult">
|
|
<select id="selectTsbDeviceList" parameterType="TsbDevice" resultMap="TsbDeviceResult">
|
|
|
- <include refid="selectTsbDeviceVo"/>
|
|
|
|
|
|
|
+ select d.device_id, d.imei, d.device_type, d.device_sn, d.dept_id, sd.dept_name,
|
|
|
|
|
+ d.device_produce_date, d.software_version, d.status, d.last_run_time, d.del_flag,
|
|
|
|
|
+ d.create_by, d.create_time, d.update_by, d.update_time, d.remark
|
|
|
|
|
+ from tsb_device d
|
|
|
|
|
+ left join sys_dept sd on sd.dept_id = d.dept_id and sd.del_flag = '0'
|
|
|
<where>
|
|
<where>
|
|
|
- and del_flag = '0'
|
|
|
|
|
|
|
+ and d.del_flag = '0'
|
|
|
<if test="deviceId != null and deviceId != 0">
|
|
<if test="deviceId != null and deviceId != 0">
|
|
|
- AND device_id = #{deviceId}
|
|
|
|
|
|
|
+ AND d.device_id = #{deviceId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="imei != null and imei != ''">
|
|
<if test="imei != null and imei != ''">
|
|
|
- AND imei like concat('%', #{imei}, '%')
|
|
|
|
|
|
|
+ AND d.imei like concat('%', #{imei}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="deviceType != null and deviceType != ''">
|
|
<if test="deviceType != null and deviceType != ''">
|
|
|
- AND device_type = #{deviceType}
|
|
|
|
|
|
|
+ AND d.device_type = #{deviceType}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="deviceSn != null">
|
|
<if test="deviceSn != null">
|
|
|
- AND device_sn = #{deviceSn}
|
|
|
|
|
|
|
+ AND d.device_sn = #{deviceSn}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="deptId != null">
|
|
|
|
|
+ AND d.dept_id = #{deptId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="status != null and status != ''">
|
|
<if test="status != null and status != ''">
|
|
|
- AND status = #{status}
|
|
|
|
|
|
|
+ AND d.status = #{status}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="params.beginProduceDate != null and params.beginProduceDate != ''">
|
|
<if test="params.beginProduceDate != null and params.beginProduceDate != ''">
|
|
|
- AND date_format(device_produce_date,'%Y%m%d') >= date_format(#{params.beginProduceDate},'%Y%m%d')
|
|
|
|
|
|
|
+ AND date_format(d.device_produce_date,'%Y%m%d') >= date_format(#{params.beginProduceDate},'%Y%m%d')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="params.endProduceDate != null and params.endProduceDate != ''">
|
|
<if test="params.endProduceDate != null and params.endProduceDate != ''">
|
|
|
- AND date_format(device_produce_date,'%Y%m%d') <= date_format(#{params.endProduceDate},'%Y%m%d')
|
|
|
|
|
|
|
+ AND date_format(d.device_produce_date,'%Y%m%d') <= date_format(#{params.endProduceDate},'%Y%m%d')
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
- order by device_id desc
|
|
|
|
|
|
|
+ order by d.device_id desc
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectTsbDeviceById" parameterType="Long" resultMap="TsbDeviceResult">
|
|
<select id="selectTsbDeviceById" parameterType="Long" resultMap="TsbDeviceResult">
|
|
@@ -87,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="imei != null and imei != ''">imei,</if>
|
|
<if test="imei != null and imei != ''">imei,</if>
|
|
|
<if test="deviceType != null and deviceType != ''">device_type,</if>
|
|
<if test="deviceType != null and deviceType != ''">device_type,</if>
|
|
|
<if test="deviceSn != null">device_sn,</if>
|
|
<if test="deviceSn != null">device_sn,</if>
|
|
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
<if test="deviceProduceDate != null">device_produce_date,</if>
|
|
<if test="deviceProduceDate != null">device_produce_date,</if>
|
|
|
<if test="softwareVersion != null and softwareVersion != ''">software_version,</if>
|
|
<if test="softwareVersion != null and softwareVersion != ''">software_version,</if>
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
<if test="status != null and status != ''">status,</if>
|
|
@@ -99,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="imei != null and imei != ''">#{imei},</if>
|
|
<if test="imei != null and imei != ''">#{imei},</if>
|
|
|
<if test="deviceType != null and deviceType != ''">#{deviceType},</if>
|
|
<if test="deviceType != null and deviceType != ''">#{deviceType},</if>
|
|
|
<if test="deviceSn != null">#{deviceSn},</if>
|
|
<if test="deviceSn != null">#{deviceSn},</if>
|
|
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
<if test="deviceProduceDate != null">#{deviceProduceDate},</if>
|
|
<if test="deviceProduceDate != null">#{deviceProduceDate},</if>
|
|
|
<if test="softwareVersion != null and softwareVersion != ''">#{softwareVersion},</if>
|
|
<if test="softwareVersion != null and softwareVersion != ''">#{softwareVersion},</if>
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
@@ -115,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="imei != null and imei != ''">imei = #{imei},</if>
|
|
<if test="imei != null and imei != ''">imei = #{imei},</if>
|
|
|
<if test="deviceType != null and deviceType != ''">device_type = #{deviceType},</if>
|
|
<if test="deviceType != null and deviceType != ''">device_type = #{deviceType},</if>
|
|
|
<if test="deviceSn != null">device_sn = #{deviceSn},</if>
|
|
<if test="deviceSn != null">device_sn = #{deviceSn},</if>
|
|
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
<if test="deviceProduceDate != null">device_produce_date = #{deviceProduceDate},</if>
|
|
<if test="deviceProduceDate != null">device_produce_date = #{deviceProduceDate},</if>
|
|
|
<if test="softwareVersion != null and softwareVersion != ''">software_version = #{softwareVersion},</if>
|
|
<if test="softwareVersion != null and softwareVersion != ''">software_version = #{softwareVersion},</if>
|
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
<if test="status != null and status != ''">status = #{status},</if>
|