|
|
@@ -38,4 +38,92 @@
|
|
|
inner join acc_team_member m on t.id = m.team_id
|
|
|
where m.user_id = #{userId} and m.activity_id = #{activityId}
|
|
|
</select>
|
|
|
+
|
|
|
+ <sql id="selectAccTeamVo">
|
|
|
+ select id, activity_id, team_code, team_name, city, leader_id, leader_name, leader_phone, member_count, status, audit_remark, audit_time, created_at, updated_at from acc_team
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectAccTeamList" parameterType="AccTeam" resultMap="BaseResultMap">
|
|
|
+ <include refid="selectAccTeamVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="activityId != null "> and activity_id = #{activityId}</if>
|
|
|
+ <if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
|
|
|
+ <if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
|
|
|
+ <if test="city != null and city != ''"> and city = #{city}</if>
|
|
|
+ <if test="leaderId != null "> and leader_id = #{leaderId}</if>
|
|
|
+ <if test="leaderName != null and leaderName != ''"> and leader_name like concat('%', #{leaderName}, '%')</if>
|
|
|
+ <if test="leaderPhone != null and leaderPhone != ''"> and leader_phone = #{leaderPhone}</if>
|
|
|
+ <if test="params.beginCreatedAt != null and params.beginCreatedAt != '' and params.endCreatedAt != null and params.endCreatedAt != ''"> and created_at >= CONCAT( #{params.beginCreatedAt}, ' 00:00:00' ) and created_at <= CONCAT( #{params.endCreatedAt}, ' 23:59:59' )</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectAccTeamById" parameterType="Long" resultMap="BaseResultMap">
|
|
|
+ <include refid="selectAccTeamVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertAccTeam" parameterType="AccTeam" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into acc_team
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="activityId != null">activity_id,</if>
|
|
|
+ <if test="teamCode != null and teamCode != ''">team_code,</if>
|
|
|
+ <if test="teamName != null and teamName != ''">team_name,</if>
|
|
|
+ <if test="city != null">city,</if>
|
|
|
+ <if test="leaderId != null">leader_id,</if>
|
|
|
+ <if test="leaderName != null and leaderName != ''">leader_name,</if>
|
|
|
+ <if test="leaderPhone != null and leaderPhone != ''">leader_phone,</if>
|
|
|
+ <if test="memberCount != null">member_count,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="auditRemark != null">audit_remark,</if>
|
|
|
+ <if test="auditTime != null">audit_time,</if>
|
|
|
+ <if test="createdAt != null">created_at,</if>
|
|
|
+ <if test="updatedAt != null">updated_at,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="activityId != null">#{activityId},</if>
|
|
|
+ <if test="teamCode != null and teamCode != ''">#{teamCode},</if>
|
|
|
+ <if test="teamName != null and teamName != ''">#{teamName},</if>
|
|
|
+ <if test="city != null">#{city},</if>
|
|
|
+ <if test="leaderId != null">#{leaderId},</if>
|
|
|
+ <if test="leaderName != null and leaderName != ''">#{leaderName},</if>
|
|
|
+ <if test="leaderPhone != null and leaderPhone != ''">#{leaderPhone},</if>
|
|
|
+ <if test="memberCount != null">#{memberCount},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="auditRemark != null">#{auditRemark},</if>
|
|
|
+ <if test="auditTime != null">#{auditTime},</if>
|
|
|
+ <if test="createdAt != null">#{createdAt},</if>
|
|
|
+ <if test="updatedAt != null">#{updatedAt},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateAccTeam" parameterType="AccTeam">
|
|
|
+ update acc_team
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="activityId != null">activity_id = #{activityId},</if>
|
|
|
+ <if test="teamCode != null and teamCode != ''">team_code = #{teamCode},</if>
|
|
|
+ <if test="teamName != null and teamName != ''">team_name = #{teamName},</if>
|
|
|
+ <if test="city != null">city = #{city},</if>
|
|
|
+ <if test="leaderId != null">leader_id = #{leaderId},</if>
|
|
|
+ <if test="leaderName != null and leaderName != ''">leader_name = #{leaderName},</if>
|
|
|
+ <if test="leaderPhone != null and leaderPhone != ''">leader_phone = #{leaderPhone},</if>
|
|
|
+ <if test="memberCount != null">member_count = #{memberCount},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="auditRemark != null">audit_remark = #{auditRemark},</if>
|
|
|
+ <if test="auditTime != null">audit_time = #{auditTime},</if>
|
|
|
+ <if test="createdAt != null">created_at = #{createdAt},</if>
|
|
|
+ <if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteAccTeamById" parameterType="Long">
|
|
|
+ delete from acc_team where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteAccTeamByIds" parameterType="String">
|
|
|
+ delete from acc_team where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
</mapper>
|