功能需求
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);