|
@@ -22,16 +22,21 @@
|
|
|
<result column="update_userid" jdbcType="VARCHAR" property="updateUserid"/>
|
|
|
<result column="update_userid" jdbcType="VARCHAR" property="updateUserid"/>
|
|
|
<result column="activity_state" jdbcType="INTEGER" property="activityState"/>
|
|
|
- <result column="activity_tate_name" jdbcType="VARCHAR" property="activityStateName"/>
|
|
|
+ <result column="activity_state_name" jdbcType="VARCHAR" property="activityStateName"/>
|
|
|
<result column="activity_count" jdbcType="INTEGER" property="activityCount"/>
|
|
|
- <result column="create_user_name" jdbcType="INTEGER" property="createUserName"/>
|
|
|
+ <result column="create_user_name" jdbcType="VARCHAR" property="createUserName"/>
|
|
|
+ <result column="practical_activity_user_id" jdbcType="VARCHAR" property="practicalActivityUserId"/>
|
|
|
+ <result column="state" jdbcType="INTEGER" property="state"/>
|
|
|
</resultMap>
|
|
|
<select id="selectPfPracticalActivityList" resultMap="BaseResultMap">
|
|
|
select ppa.id, ppa.activity_name, ppa.activity_type, ppa.address, ppa.begin_date, ppa.end_date,
|
|
|
ppa.begin_the_registration_time, ppa.end_the_registration_time, ppa.remark, ppa.content, ppa.other_explain,
|
|
|
ppa.activity_record_id, ppa.activity_image_id, ppa.create_time, ppa.create_userid, ppa.update_time,
|
|
|
- ppa.update_userid ,
|
|
|
- ppau.activity_count, cu.username as create_user_name
|
|
|
+ ppa.update_userid ,ppau.activity_count, cu.username as create_user_name,
|
|
|
+ case when CURDATE() <![CDATA[<]]> ppa.begin_the_registration_time then 1
|
|
|
+ when ppa.begin_the_registration_time <![CDATA[<=]]> CURDATE() and CURDATE() <![CDATA[<=]]>
|
|
|
+ ppa.end_the_registration_time then 2
|
|
|
+ when CURDATE() <![CDATA[>]]> ppa.end_the_registration_time then 3 end as activity_state
|
|
|
from pf_practical_activity ppa
|
|
|
left join (select practical_activity_id, count(0) as activity_count
|
|
|
from pf_practical_activity_user ppau
|
|
@@ -49,17 +54,46 @@
|
|
|
</if>
|
|
|
<choose>
|
|
|
<when test="beginDate!=null and endDate!=null ">
|
|
|
- and (ppa.begin_date <![CDATA[ <= ]]> #{endDate} and ppa.end_date <![CDATA[ >= ]]> #{beginDate})
|
|
|
+ and (ppa.begin_the_registration_time <![CDATA[ <= ]]> #{endDate} and ppa.end_the_registration_time
|
|
|
+ <![CDATA[ >= ]]> #{beginDate})
|
|
|
</when>
|
|
|
<when test="beginDate!=null">
|
|
|
- and ppa.begin_date <![CDATA[ >= ]]> #{beginDate}
|
|
|
+ and ppa.begin_the_registration_time <![CDATA[ >= ]]> #{beginDate}
|
|
|
</when>
|
|
|
<when test="endDate!=null">
|
|
|
- and ppa.end_date <![CDATA[ <= ]]> #{endDate}
|
|
|
+ and ppa.end_the_registration_time <![CDATA[ <= ]]> #{endDate}
|
|
|
</when>
|
|
|
</choose>
|
|
|
order by ppa.create_time desc
|
|
|
</select>
|
|
|
+ <select id="selectAppPfPracticalActivityList" resultMap="BaseResultMap">
|
|
|
+ select ppa.id, ppa.activity_name, ppa.activity_type, ppa.address, ppa.begin_date, ppa.end_date,
|
|
|
+ ppa.begin_the_registration_time, ppa.end_the_registration_time, ppa.remark, ppa.content, ppa.other_explain,
|
|
|
+ ppa.activity_record_id, ppa.activity_image_id, ppa.create_time, ppa.create_userid, ppa.update_time,
|
|
|
+ ppa.update_userid, ppau.practical_activity_user_id, ppau.state,
|
|
|
+ case when CURDATE() <![CDATA[<]]> ppa.begin_the_registration_time then 1
|
|
|
+ when ppa.begin_the_registration_time <![CDATA[<=]]> CURDATE() and CURDATE() <![CDATA[<=]]>
|
|
|
+ ppa.end_the_registration_time then 2
|
|
|
+ when CURDATE() <![CDATA[>]]> ppa.end_the_registration_time then 3 end as activity_state
|
|
|
+ from pf_practical_activity ppa
|
|
|
+ left join (select ppau.id as practical_activity_user_id, ppau.practical_activity_id, ppau.state
|
|
|
+ from pf_practical_activity_user ppau
|
|
|
+ where ppau.user_no = #{userNo}) ppau
|
|
|
+ on ppa.id = ppau.practical_activity_id
|
|
|
+ where 1=1
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and ppa.id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==1">
|
|
|
+ and ppa.begin_the_registration_time <![CDATA[<=]]> CURDATE() and CURDATE() <![CDATA[<=]]>
|
|
|
+ ppa.end_the_registration_time
|
|
|
+ and (ppau.state is null or ppau.state = 1)
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type==2">
|
|
|
+ and ppau.state = 2
|
|
|
+ </if>
|
|
|
+ order by ppa.create_time desc
|
|
|
+ </select>
|
|
|
<select id="selectAddressList" resultType="java.lang.String">
|
|
|
select c.address
|
|
|
from pf_practical_activity c
|
|
@@ -108,4 +142,12 @@
|
|
|
</if>
|
|
|
order by ppau.create_time desc
|
|
|
</select>
|
|
|
+ <select id="findPfPracticalActivityUser" resultType="java.lang.String">
|
|
|
+ select GROUP_CONCAT(user_name) from pf_practical_activity_user
|
|
|
+ where practical_activity_id = #{practicalActivityId}
|
|
|
+ and user_no in
|
|
|
+ <foreach collection="userNoList" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
</mapper>
|