日照智慧社区接口服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.2 KiB

2 years ago
<?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.epmet.dao.PovertyCondoleDao">
<resultMap type="com.epmet.entity.PovertyCondoleEntity" id="povertyCondoleMap">
<result property="id" column="ID"/>
<result property="povertyId" column="POVERTY_ID"/>
<result property="resiUserId" column="RESI_USER_ID"/>
<result property="userName" column="USER_NAME"/>
<result property="condoleTime" column="CONDOLE_TIME"/>
<result property="condoleStaff" column="CONDOLE_STAFF"/>
<result property="content" column="CONTENT"/>
<result property="remark" column="REMARK"/>
<result property="orgIdPath" column="ORG_ID_PATH"/>
2 years ago
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<sql id="retrunMap">
pc.id,
pm.USER_NAME,
pm.MOBILE,
pm.ID_CARD,
pm.POVERTY_TYPE,
pm.POVERTY_STATUS,
pc.CONDOLE_TIME,
pc.CONDOLE_STAFF,
pc.CONTENT,
pc.REMARK
</sql>
<select id="search" resultType="com.epmet.dto.PovertyCondoleDTO">
SELECT
<include refid="retrunMap"/>
FROM poverty_condole pc
LEFT JOIN poverty_manage pm ON pc.POVERTY_ID = pm.ID
<where>
pc.DEL_FLAG = 0 AND pc.ORG_ID_PATH LIKE concat(#{orgIdPath},'%')
2 years ago
<if test="null != content and content != ''">
AND pc.CONTENT LIKE concat( '%', #{content}, '%')
</if>
<if test="null != userName and userName != ''">
AND pm.USER_NAME LIKE concat( '%', #{userName}, '%')
</if>
<if test="null != idCard and idCard != ''">
AND pm.ID_CARD LIKE concat( '%', #{idCard}, '%')
</if>
<if test="null != povertyType and povertyType != ''">
AND pm.POVERTY_TYPE = #{povertyType}
</if>
<if test="null != povertyStatus and povertyStatus != ''">
AND pm.POVERTY_STATUS = #{povertyStatus}
</if>
<if test="null != condoleStaff and condoleStaff != ''">
AND pc.CONDOLE_STAFF LIKE concat( '%', #{condoleStaff}, '%')
</if>
<if test="null != startTime and startTime != '' and null != endTime and endTime !=''">
AND DATE_FORMAT(pc.CONDOLE_TIME,"%Y-%m-%d") BETWEEN DATE_FORMAT(#{startTime},"%Y-%m-%d") AND
DATE_FORMAT(#{endTime},"%Y-%m-%d")
</if>
<if test="null != startTime and startTime != ''">
AND DATE_FORMAT(pc.CONDOLE_TIME,"%Y-%m-%d") &gt;= DATE_FORMAT(#{startTime},"%Y-%m-%d")
</if>
<if test="null != endTime and endTime != ''">
AND DATE_FORMAT(pc.CONDOLE_TIME,"%Y-%m-%d") &lt;= DATE_FORMAT(#{endTime},"%Y-%m-%d")
</if>
</where>
</select>
</mapper>