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.
75 lines
2.8 KiB
75 lines
2.8 KiB
<?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.VolunteerInfoDao">
|
|
|
|
<resultMap type="com.epmet.entity.VolunteerInfoEntity" id="volunteerInfoMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="gridId" column="GRID_ID"/>
|
|
<result property="gridName" column="GRID_NAME"/>
|
|
<result property="userId" column="USER_ID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="volunteerIntroduce" column="VOLUNTEER_INTRODUCE"/>
|
|
<result property="volunteerSignature" column="VOLUNTEER_SIGNATURE"/>
|
|
<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"/>
|
|
<result property="pid" column="PID"/>
|
|
<result property="pids" column="PIDS"/>
|
|
</resultMap>
|
|
|
|
<select id="queryVolunteerFlagByUserId" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
SELECT
|
|
count(1)
|
|
FROM volunteer_info
|
|
WHERE DEL_FLAG = '0'
|
|
AND USER_ID = #{userId}
|
|
</select>
|
|
|
|
<update id="updateVolunteerInfoByUserId" parameterType="com.epmet.entity.VolunteerInfoEntity">
|
|
UPDATE volunteer_info
|
|
SET
|
|
<if test="customerId != null and customerId != ''">
|
|
CUSTOMER_ID = #{customerId},
|
|
</if>
|
|
<if test="volunteerIntroduce != null">
|
|
VOLUNTEER_INTRODUCE = #{volunteerIntroduce},
|
|
</if>
|
|
<if test="volunteerSignature != null">
|
|
VOLUNTEER_SIGNATURE = #{volunteerSignature},
|
|
</if>
|
|
<if test="userId != null and userId != ''">
|
|
UPDATED_BY = #{userId},
|
|
</if>
|
|
<if test="gridId != null and gridId != ''">
|
|
GRID_ID = #{gridId},
|
|
</if>
|
|
<if test="gridName != null and gridName != ''">
|
|
GRID_NAME = #{gridName},
|
|
</if>
|
|
UPDATED_TIME = now()
|
|
WHERE DEL_FLAG = '0'
|
|
AND USER_ID = #{userId}
|
|
</update>
|
|
|
|
<select id="selectVolunteerInfoByUserId" parameterType="java.lang.String" resultType="com.epmet.dto.VolunteerInfoDTO">
|
|
SELECT
|
|
*
|
|
FROM volunteer_info
|
|
WHERE DEL_FLAG = '0'
|
|
AND USER_ID = #{userId}
|
|
</select>
|
|
|
|
<!-- 查询一个客户下的所有志愿者用户Id -->
|
|
<select id="selectVolunteerIds" resultType="string">
|
|
SELECT
|
|
distinct USER_ID
|
|
FROM volunteer_info
|
|
WHERE DEL_FLAG = '0'
|
|
AND CUSTOMER_ID = #{customerId}
|
|
order by CREATED_TIME asc
|
|
</select>
|
|
</mapper>
|
|
|