12 changed files with 261 additions and 24 deletions
@ -0,0 +1,23 @@ |
|||
package com.ccsens.wisdomcar.persist.dao; |
|||
|
|||
|
|||
import com.ccsens.wisdomcar.bean.dto.RfidDto; |
|||
import com.ccsens.wisdomcar.bean.vo.RfidVo; |
|||
import com.ccsens.wisdomcar.persist.mapper.RfidMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author AUSU |
|||
*/ |
|||
public interface RfidDao extends RfidMapper { |
|||
|
|||
/** |
|||
* 查看rfid列表 |
|||
* @param param 参数 |
|||
* @return rfid列表 |
|||
*/ |
|||
List<RfidVo.QueryRfid> findAllRfid(RfidDto.QueryRfid param); |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
<?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.ccsens.wisdomcar.persist.dao.RfidDao"> |
|||
|
|||
|
|||
<select id="findAllRfid" resultType="com.ccsens.wisdomcar.bean.vo.RfidVo$QueryRfid"> |
|||
SELECT |
|||
tr.id AS id, |
|||
tr.rfid AS rfid, |
|||
tr.type AS type, |
|||
tr. NAME AS `name`, |
|||
tr.step_id AS step, |
|||
ts.`name` AS stepName, |
|||
tr.hospital_id AS hospitalId, |
|||
th.hospital_name AS hospitalName |
|||
FROM |
|||
t_rfid AS tr |
|||
LEFT JOIN t_step AS ts ON ts.id = tr.step_id |
|||
AND ts.rec_status = 0 |
|||
LEFT JOIN t_hospital th ON th.id = tr.hospital_id |
|||
AND th.rec_status = 0 |
|||
WHERE |
|||
tr.rec_status = 0 |
|||
<if test="rfid != null and rfid != ''"> |
|||
AND tr.rfid like concat('%',conv(#{rfid}, 16, 10 ),'%') |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND tr.`name` like concat('%',#{name},'%') |
|||
</if> |
|||
<if test="type != null and type != '' or type == 0"> |
|||
AND tr.type = #{type} |
|||
</if> |
|||
<if test="step != null and step != ''"> |
|||
AND tr.step_id = #{step} |
|||
</if> |
|||
<if test="hospitalId != null and hospitalId != ''"> |
|||
AND tr.hospital_id = #{hospitalId} |
|||
</if> |
|||
</select> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue