|
@@ -2,21 +2,21 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.huimv.wine.mapper.WorkerMapper">
|
|
|
|
|
|
- <!-- 通用查询映射结果 -->
|
|
|
<resultMap id="WorkerQueryResultMap" type="com.huimv.wine.entity.vo.WorkerQueryResult">
|
|
|
<id column="id" property="id" />
|
|
|
<result column="status" property="status" />
|
|
|
<result column="publish" property="publish" />
|
|
|
<result column="finish" property="finish" />
|
|
|
- <association property="device" javaType="com.huimv.wine.entity.vo.DeviceWithIdAddrVo" select="com.huimv.wine.mapper.DeviceMapper.getDeviceByDeviceId" column="device_id"/>
|
|
|
+ <association property="device" javaType="com.huimv.wine.entity.vo.DeviceWithIdAddrVo" select="com.huimv.wine.mapper.DeviceMapper.getDeviceByDeviceId" column="deviceId"/>
|
|
|
</resultMap>
|
|
|
- <select id="login" resultType="com.huimv.wine.entity.Worker">
|
|
|
- select * FROM `worker` WHERE phone=#{account} AND password = #{password}
|
|
|
- </select>
|
|
|
<select id="ChangesQueryForWorker" resultMap="WorkerQueryResultMap">
|
|
|
- SELECT c.`id` as 'id',d.`id` as 'device_id',c.`status` as 'status',c.`publish` as 'publish',c.`finish` as 'finish'
|
|
|
+ SELECT c.`id` as 'id',d.`id` as 'deviceId',c.`status` as 'status',c.`publish` as 'publish',c.`finish` as 'finish'
|
|
|
FROM `change` AS c LEFT JOIN `device` AS d ON c.`device`=d.`id`
|
|
|
WHERE c.`status`=#{status} AND c.`worker`=#{worker} AND (d.`id` LIKE #{like} OR d.`addr` LIKE #{like})
|
|
|
</select>
|
|
|
|
|
|
+ <select id="login" resultType="com.huimv.wine.entity.Worker">
|
|
|
+ select * FROM `worker` WHERE phone=#{account} AND password = #{password}
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|