<?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.ruoyi.system.mapper.TOldsterWarningMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.system.model.TOldsterWarning">
|
<id column="id" property="id" />
|
<result column="oldster_id" property="oldsterId" />
|
<result column="warning_time" property="warningTime" />
|
<result column="create_time" property="createTime" />
|
<result column="update_time" property="updateTime" />
|
<result column="create_by" property="createBy" />
|
<result column="update_by" property="updateBy" />
|
<result column="disabled" property="disabled" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, oldster_id, warning_time, create_time, update_time, create_by, update_by, disabled
|
</sql>
|
<select id="pageList" resultType="com.ruoyi.system.vo.TOldsterWarningVO">
|
select tow.id, tow.oldster_id, tow.warning_time, tow.create_time, tow.update_time, tow.create_by, tow.update_by, tow.disabled,
|
t.oldster_name, t.oldster_age, t.oldster_sex, t.contact_phone, t.guardian_name, t.guardian_phone,
|
t.passport_photo, t.id_card, t.birth_date, t.oldster_type, t.address
|
from t_oldster_warning tow
|
left join t_oldster t on tow.oldster_id = t.id
|
<where>
|
<if test="query.oldsterName != null and query.oldsterName != ''">
|
and t.oldster_name like concat('%',#{query.oldsterName},'%')
|
</if>
|
<if test="query.oldsterType != null and query.oldsterType != ''">
|
and t.oldster_type = #{query.oldsterType}
|
</if>
|
<if test="query.contactPhone != null and query.contactPhone != ''">
|
and t.contact_phone like concat('%',#{query.contactPhone},'%')
|
</if>
|
AND tow.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
order by tow.warning_time desc
|
</select>
|
<select id="exportOldsterWarning" resultType="com.ruoyi.system.export.TOldsterWarningExport">
|
select tow.id, tow.oldster_id, tow.warning_time, tow.create_time, tow.update_time, tow.create_by, tow.update_by, tow.disabled,
|
t.oldster_name, t.oldster_age, t.oldster_sex, t.contact_phone, t.guardian_name, t.guardian_phone,
|
t.passport_photo, t.id_card, t.birth_date, t.oldster_type, t.address
|
from t_oldster_warning tow
|
left join t_oldster t on tow.oldster_id = t.id
|
<where>
|
<if test="query.oldsterName != null and query.oldsterName != ''">
|
and t.oldster_name like concat('%',#{query.oldsterName},'%')
|
</if>
|
<if test="query.oldsterType != null and query.oldsterType != ''">
|
and t.oldster_type = #{query.oldsterType}
|
</if>
|
<if test="query.contactPhone != null and query.contactPhone != ''">
|
and t.contact_phone like concat('%',#{query.contactPhone},'%')
|
</if>
|
AND tow.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
order by tow.warning_time desc
|
</select>
|
|
</mapper>
|