|
|
@@ -65,47 +65,47 @@
|
|
|
</update>
|
|
|
|
|
|
<select id="queryCount" parameterType="map" resultType="int">
|
|
|
- select count(*) from luck_draw_log l
|
|
|
- left join luck_draw_prize d on l.prize_id_ = d.id_
|
|
|
- left join sys_user u on u.id_=l.user_id_
|
|
|
+ SELECT COUNT(*) FROM luck_draw_log l
|
|
|
+ LEFT JOIN luck_draw_prize d ON l.prize_id_ = d.id_
|
|
|
+ LEFT JOIN sys_user u ON u.id_=l.user_id_
|
|
|
<include refid="queryCondition" />
|
|
|
</select>
|
|
|
|
|
|
<select id="queryPage" parameterType="map" resultMap="BaseResultMapExt">
|
|
|
- select <include refid="Base_Column_List" />,u.username_,u.phone_,o.name_ organ_name_ from luck_draw_log l
|
|
|
- left join luck_draw_prize d on l.prize_id_ = d.id_
|
|
|
- left join sys_user u on u.id_=l.user_id_
|
|
|
- left join organization o on o.id_ = u.organ_id_
|
|
|
+ SELECT <include refid="Base_Column_List" />,u.username_,u.phone_,o.name_ organ_name_ FROM luck_draw_log l
|
|
|
+ LEFT JOIN luck_draw_prize d ON l.prize_id_ = d.id_
|
|
|
+ LEFT JOIN sys_user u ON u.id_=l.user_id_
|
|
|
+ LEFT JOIN organization o ON o.id_ = u.organ_id_
|
|
|
<include refid="queryCondition" />
|
|
|
- order by l.create_on_ desc
|
|
|
+ ORDER BY l.create_on_ DESC
|
|
|
<include refid="global.limit" />
|
|
|
</select>
|
|
|
|
|
|
<sql id="queryCondition">
|
|
|
<where>
|
|
|
<if test="prizeId != null">
|
|
|
- and l.prize_id_ = #{id}
|
|
|
+ AND l.prize_id_ = #{id}
|
|
|
</if>
|
|
|
<if test="userId != null">
|
|
|
- and l.user_id_ = #{userId}
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- and d.name_ like concat('%',#{name},'%')
|
|
|
+ AND l.user_id_ = #{userId}
|
|
|
</if>
|
|
|
<if test="rewardType != null">
|
|
|
- and d.reward_type_ like concat('%',#{rewardType},'%')
|
|
|
+ AND d.reward_type_ LIKE CONCAT('%',#{rewardType},'%')
|
|
|
</if>
|
|
|
<if test="groupId != null">
|
|
|
- and l.group_id_ = #{groupId}
|
|
|
+ AND l.group_id_ = #{groupId}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND d.name_ = #{name}
|
|
|
</if>
|
|
|
<if test="startDate != null">
|
|
|
- and l.create_on_ >= #{startDate}
|
|
|
+ AND l.create_on_ >= #{startDate}
|
|
|
</if>
|
|
|
<if test="endDate != null">
|
|
|
- and l.create_on_ <= #{endDate}
|
|
|
+ AND l.create_on_ <= #{endDate}
|
|
|
</if>
|
|
|
<if test="organId != null">
|
|
|
- and u.organ_id_ = #{organId}
|
|
|
+ AND u.organ_id_ = #{organId}
|
|
|
</if>
|
|
|
<if test="search != null and search != ''">
|
|
|
AND (u.username_ = LIKE CONCAT('%',#{search},'%') OR u.id_ = #{search})
|