二十一、线索转换5:删除

功能需求

8.删除该线索所有备注

9.删除该线索和市场活动

10.删除该线索

代码实现

1.ClueRemarkMapper

    /**
     *根据线索id删除
     */
    int deleteClueRemarkByClueId(String[] clueIds);
    <delete id="deleteClueRemarkByClueId">
        delete from tbl_clue_remark
        where clue_id in
        <foreach collection="array" item="id" separator="," open="(" close=")">
            #{id, jdbcType=VARCHAR}
        </foreach>
    </delete>

2.ClueActivityRelationMapper

    /**
     *根据线索id删除
     */
	int deleteClueActivityRelationByClueIds(String[] clueIds);
    <delete id="deleteClueActivityRelationByClueIds">
        delete from tbl_clue_activity_relation
        where clue_id in
        <foreach collection="array" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
    </delete>

3.ClueMapper

    /**
     * 通过id删除选则的线索
     * @param clueIds 线索id数组
     * @return 删除的条数
     */
    int deleteClueByIds(String[] clueIds);
    <delete id="deleteClueByIds" parameterType="string">
        delete from tbl_clue
        where id in
        <foreach collection="array" item="id" separator="," open="(" close=")">
            #{id, jdbcType=VARCHAR}
        </foreach>
    </delete>

4.ClueService

	// 6. 删除 线索备注 线索和市场关联 线索
		String[] clueIds = {clueId};
		// 删除线索备注
		clueRemarkMapper.deleteClueRemarkByClueId(clueIds);
		// 删除线索和市场关联
		clueActivityRelationMapper.deleteClueActivityRelationByClueIds(clueIds);
		// 删除线索
		clueMapper.deleteClueByIds(clueIds);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值