Commit 22a581d1 by 水库浪子

修复组织架构相关bug

1 parent 37ee1a0f
...@@ -53,7 +53,8 @@ public class WeDepartmentController extends BaseController ...@@ -53,7 +53,8 @@ public class WeDepartmentController extends BaseController
@ApiOperation("添加部门") @ApiOperation("添加部门")
public AjaxResult add(@Validated @RequestBody WeDepartment weDepartment) public AjaxResult add(@Validated @RequestBody WeDepartment weDepartment)
{ {
return toAjax(weDepartmentService.insertWeDepartment(weDepartment)); weDepartmentService.insertWeDepartment(weDepartment);
return AjaxResult.success();
} }
/** /**
...@@ -65,7 +66,8 @@ public class WeDepartmentController extends BaseController ...@@ -65,7 +66,8 @@ public class WeDepartmentController extends BaseController
@ApiOperation("更新部门") @ApiOperation("更新部门")
public AjaxResult edit(@RequestBody WeDepartment weDepartment) public AjaxResult edit(@RequestBody WeDepartment weDepartment)
{ {
return toAjax(weDepartmentService.updateWeDepartment(weDepartment)); weDepartmentService.updateWeDepartment(weDepartment);
return AjaxResult.success();
} }
// //
// /** // /**
......
...@@ -45,6 +45,7 @@ public class WeUserController extends BaseController { ...@@ -45,6 +45,7 @@ public class WeUserController extends BaseController {
public TableDataInfo list(WeUser weUser) public TableDataInfo list(WeUser weUser)
{ {
startPage(); startPage();
List<WeUser> list = weUserService.selectWeUserList(weUser); List<WeUser> list = weUserService.selectWeUserList(weUser);
return getDataTable(list); return getDataTable(list);
} }
......
package com.linkwechat.wecom.domain; package com.linkwechat.wecom.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.linkwechat.common.core.domain.BaseEntity; import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil; import com.linkwechat.common.utils.SnowFlakeUtil;
...@@ -25,12 +26,13 @@ import javax.validation.constraints.NotNull; ...@@ -25,12 +26,13 @@ import javax.validation.constraints.NotNull;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@TableName("we_department") @TableName("we_department")
public class WeDepartment extends BaseEntity public class WeDepartment
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** $column.columnComment */ /** $column.columnComment */
private Long id= SnowFlakeUtil.nextId(); @TableId
private Long id;
/** 部门名称 */ /** 部门名称 */
......
...@@ -77,4 +77,9 @@ public class WeFlowerCustomerRel ...@@ -77,4 +77,9 @@ public class WeFlowerCustomerRel
@TableField(exist = false) @TableField(exist = false)
private List<WeFlowerCustomerTagRel> weFlowerCustomerTagRels; private List<WeFlowerCustomerTagRel> weFlowerCustomerTagRels;
@TableField(exist = false)
private String department;
} }
...@@ -47,4 +47,7 @@ public class WeFlowerCustomerTagRel ...@@ -47,4 +47,7 @@ public class WeFlowerCustomerTagRel
private Date createTime; private Date createTime;
} }
...@@ -40,6 +40,7 @@ public class WeGroupMember { ...@@ -40,6 +40,7 @@ public class WeGroupMember {
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date joinTime; private Date joinTime;
/**入群方式: 1 - 由成员邀请入群(直接邀请入群) ; 2 - 由成员邀请入群(通过邀请链接入群); 3 - 通过扫描群二维码入群 */
private Integer joinScene; private Integer joinScene;
@TableField(value="type") @TableField(value="type")
......
...@@ -31,7 +31,7 @@ public class CustomerGroupDetail extends WeResultDto { ...@@ -31,7 +31,7 @@ public class CustomerGroupDetail extends WeResultDto {
private String owner; private String owner;
/**群的创建时间*/ /**群的创建时间*/
private Date create_time; private long create_time;
/**群公告*/ /**群公告*/
private String notice; private String notice;
......
...@@ -18,7 +18,7 @@ public class CustomerGroupMember { ...@@ -18,7 +18,7 @@ public class CustomerGroupMember {
private Integer type; private Integer type;
/**入群时间*/ /**入群时间*/
private Date join_time; private long join_time;
/**1 - 由成员邀请入群(直接邀请入群);2 - 由成员邀请入群(通过邀请链接入群);3 - 通过扫描群二维码入群*/ /**1 - 由成员邀请入群(直接邀请入群);2 - 由成员邀请入群(通过邀请链接入群);3 - 通过扫描群二维码入群*/
private Integer join_scene; private Integer join_scene;
......
...@@ -55,7 +55,7 @@ public class ExternalUserDetail extends WeResultDto { ...@@ -55,7 +55,7 @@ public class ExternalUserDetail extends WeResultDto {
/**该成员对此外部联系人的描述*/ /**该成员对此外部联系人的描述*/
private String description; private String description;
/**该成员添加此外部联系人的时间*/ /**该成员添加此外部联系人的时间*/
private Date createtime; private long createtime;
/**该成员对此客户备注的企业名称*/ /**该成员对此客户备注的企业名称*/
private String remark_company; private String remark_company;
/**该成员对此客户备注的手机号码*/ /**该成员对此客户备注的手机号码*/
......
...@@ -35,7 +35,7 @@ public interface IWeDepartmentService extends IService<WeDepartment> ...@@ -35,7 +35,7 @@ public interface IWeDepartmentService extends IService<WeDepartment>
* @param weDepartment 企业微信组织架构相关 * @param weDepartment 企业微信组织架构相关
* @return 结果 * @return 结果
*/ */
public int insertWeDepartment(WeDepartment weDepartment); public void insertWeDepartment(WeDepartment weDepartment);
/** /**
* 修改企业微信组织架构相关 * 修改企业微信组织架构相关
...@@ -43,7 +43,7 @@ public interface IWeDepartmentService extends IService<WeDepartment> ...@@ -43,7 +43,7 @@ public interface IWeDepartmentService extends IService<WeDepartment>
* @param weDepartment 企业微信组织架构相关 * @param weDepartment 企业微信组织架构相关
* @return 结果 * @return 结果
*/ */
public int updateWeDepartment(WeDepartment weDepartment); public void updateWeDepartment(WeDepartment weDepartment);
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.common.constant.WeConstans; import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.common.utils.SecurityUtils; import com.linkwechat.common.utils.SecurityUtils;
import com.linkwechat.common.utils.SnowFlakeUtil; import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.common.utils.bean.BeanUtils; import com.linkwechat.common.utils.bean.BeanUtils;
...@@ -71,11 +72,6 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom ...@@ -71,11 +72,6 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
private IWeAllocateCustomerService iWeAllocateCustomerService; private IWeAllocateCustomerService iWeAllocateCustomerService;
@Autowired @Autowired
private WeUserClient weUserClient; private WeUserClient weUserClient;
...@@ -149,12 +145,24 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom ...@@ -149,12 +145,24 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
List<WeFlowerCustomerTagRel> weFlowerCustomerTagRels=new ArrayList<>(); List<WeFlowerCustomerTagRel> weFlowerCustomerTagRels=new ArrayList<>();
List<WeFlowerCustomerRel> weFlowerCustomerRel=new ArrayList<>(); List<WeFlowerCustomerRel> weFlowerCustomerRel=new ArrayList<>();
externalUserDetail.getFollow_user().stream().forEach(kk->{ externalUserDetail.getFollow_user().stream().forEach(kk->{
WeFlowerCustomerRel weFlowerCustomerRelOne=new WeFlowerCustomerRel(); // WeFlowerCustomerRel weFlowerCustomerRelOne=new WeFlowerCustomerRel();
BeanUtils.copyPropertiesignoreOther(kk,weFlowerCustomerRelOne); // BeanUtils.copyPropertiesignoreOther(kk,weFlowerCustomerRelOne);
Long weFlowerCustomerRelId=SnowFlakeUtil.nextId(); Long weFlowerCustomerRelId=SnowFlakeUtil.nextId();
weFlowerCustomerRelOne.setId(weFlowerCustomerRelId); // weFlowerCustomerRelOne.setId(weFlowerCustomerRelId);
weFlowerCustomerRelOne.setExternalUserid(weCustomer.getExternalUserid()); // weFlowerCustomerRelOne.setExternalUserid(weCustomer.getExternalUserid());
weFlowerCustomerRel.add(weFlowerCustomerRelOne); weFlowerCustomerRel.add(WeFlowerCustomerRel.builder()
.id(weFlowerCustomerRelId)
.userId(kk.getUserid())
.description(kk.getDescription())
.remarkCorpName(kk.getRemark_company())
.remarkMobiles(kk.getRemark_mobiles())
.operUserid(kk.getOper_userid())
.addWay(kk.getAdd_way())
.externalUserid(weCustomer.getExternalUserid())
.createTime(new Date(kk.getCreatetime() * 1000L))
.build());
List<ExternalUserTag> tags = kk.getTags(); List<ExternalUserTag> tags = kk.getTags();
if(CollectionUtil.isNotEmpty(tags)){ if(CollectionUtil.isNotEmpty(tags)){
...@@ -339,7 +347,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom ...@@ -339,7 +347,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
List<WeTag> addTags = weMakeCustomerTag.getAddTag(); List<WeTag> addTags = weMakeCustomerTag.getAddTag();
if(CollectionUtil.isNotEmpty(addTags)){ if(CollectionUtil.isNotEmpty(addTags)){
addTags.removeAll(Collections.singleton(null));
List<WeFlowerCustomerTagRel> tagRels=new ArrayList<>(); List<WeFlowerCustomerTagRel> tagRels=new ArrayList<>();
List<CutomerTagEdit> cutomerTagEdits=new ArrayList<>(); List<CutomerTagEdit> cutomerTagEdits=new ArrayList<>();
...@@ -393,15 +403,24 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom ...@@ -393,15 +403,24 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
if(CollectionUtil.isNotEmpty(addTags)){ if(CollectionUtil.isNotEmpty(addTags)){
//获取当前客户需要移除的标签
List<WeFlowerCustomerTagRel> removeTag = iWeFlowerCustomerTagRelService.list(new LambdaQueryWrapper<WeFlowerCustomerTagRel>()
.in(WeFlowerCustomerTagRel::getFlowerCustomerRelId, iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>().eq(WeFlowerCustomerRel::getExternalUserid
, weMakeCustomerTag.getExternalUserid())).stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList()))
.notIn(WeFlowerCustomerTagRel::getTagId, addTags.stream().map(WeTag::getTagId).collect(Collectors.toList()))
);
//查询出当前用户对应的 //查询出当前用户对应的
List<WeFlowerCustomerRel> flowerCustomerRels = iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>() List<WeFlowerCustomerRel> flowerCustomerRels = iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>()
.eq(WeFlowerCustomerRel::getExternalUserid, weMakeCustomerTag.getExternalUserid())); .eq(WeFlowerCustomerRel::getExternalUserid, weMakeCustomerTag.getExternalUserid()));
if(CollectionUtil.isNotEmpty(flowerCustomerRels) ){ if(CollectionUtil.isNotEmpty(flowerCustomerRels) ){
if(iWeFlowerCustomerTagRelService.remove( if(iWeFlowerCustomerTagRelService.remove(
new LambdaQueryWrapper<WeFlowerCustomerTagRel>() new LambdaQueryWrapper<WeFlowerCustomerTagRel>()
.in(WeFlowerCustomerTagRel::getFlowerCustomerRelId, flowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList())) .in(WeFlowerCustomerTagRel::getFlowerCustomerRelId, flowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList()))
.in(WeFlowerCustomerTagRel::getTagId, addTags.stream().map(WeTag::getTagId).collect(Collectors.toList())) .in(WeFlowerCustomerTagRel::getTagId, removeTag.stream().map(WeFlowerCustomerTagRel::getTagId).collect(Collectors.toList()))
)){ )){
flowerCustomerRels.stream().forEach(k->{ flowerCustomerRels.stream().forEach(k->{
...@@ -409,7 +428,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom ...@@ -409,7 +428,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
CutomerTagEdit.builder() CutomerTagEdit.builder()
.external_userid(k.getExternalUserid()) .external_userid(k.getExternalUserid())
.userid(k.getUserId()) .userid(k.getUserId())
.remove_tag(ArrayUtil.toArray(addTags.stream().map(WeTag::getTagId).collect(Collectors.toList()), String.class)) .remove_tag(ArrayUtil.toArray(removeTag.stream().map(WeFlowerCustomerTagRel::getTagId).collect(Collectors.toList()), String.class))
.build() .build()
); );
......
...@@ -86,23 +86,20 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe ...@@ -86,23 +86,20 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe
* @return 结果 * @return 结果
*/ */
@Override @Override
@Transactional public void insertWeDepartment(WeDepartment weDepartment)
public int insertWeDepartment(WeDepartment weDepartment)
{ {
weDepartment.setId(SnowFlakeUtil.nextId());
int returnCode=weDepartmentMapper.insertWeDepartment(weDepartment);
if(returnCode>0){
WeResultDto weDepartMent = weDepartMentClient.createWeDepartMent(
weDepartment.transformDeartMentDto(weDepartment)
);
weDepartMentClient.createWeDepartMent( if(weDepartMent.getErrcode().equals(WeConstans.WE_SUCCESS_CODE) && weDepartMent.getId() != null){
weDepartment.transformDeartMentDto(weDepartment)
);
weDepartment.setId(weDepartMent.getId());
} this.save(weDepartment);
}
return returnCode;
} }
/** /**
...@@ -112,20 +109,29 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe ...@@ -112,20 +109,29 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateWeDepartment(WeDepartment weDepartment) public void updateWeDepartment(WeDepartment weDepartment)
{ {
int returnCode=weDepartmentMapper.updateWeDepartment(weDepartment); WeResultDto weDepartMent = weDepartMentClient.updateWeDepartMent(
if(returnCode>0){ weDepartment.transformDeartMentDto(weDepartment)
);
weDepartMentClient.updateWeDepartMent(
weDepartment.transformDeartMentDto(weDepartment)
);
if(weDepartMent.getErrcode().equals(WeConstans.WE_SUCCESS_CODE)){
this.updateById(weDepartment);
} }
return returnCode; // int returnCode=weDepartmentMapper.updateWeDepartment(weDepartment);
// if(returnCode>0){
//
// weDepartMentClient.updateWeDepartMent(
// weDepartment.transformDeartMentDto(weDepartment)
// );
//
//
// }
//
// return returnCode;
} }
...@@ -159,8 +165,7 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe ...@@ -159,8 +165,7 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe
public List<WeDepartment> synchWeDepartment() { public List<WeDepartment> synchWeDepartment() {
List<WeDepartment> weDepartments = weDepartMentClient.weAllDepartMents().findWeDepartments(); List<WeDepartment> weDepartments = weDepartMentClient.weAllDepartMents().findWeDepartments();
if(CollectionUtil.isNotEmpty(weDepartments)){ if(CollectionUtil.isNotEmpty(weDepartments)){
this.deleteAllWeDepartment(); this.saveOrUpdateBatch(weDepartments);
this.batchInsertWeDepartment(weDepartments);
} }
return weDepartments; return weDepartments;
......
...@@ -136,7 +136,7 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple ...@@ -136,7 +136,7 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple
.groupName(kk.getName()) .groupName(kk.getName())
.notice(kk.getNotice()) .notice(kk.getNotice())
.owner(kk.getOwner()) .owner(kk.getOwner())
.createTime(kk.getCreate_time()) .createTime(new Date(kk.getCreate_time() * 1000L))
.status(k.getStatus()) .status(k.getStatus())
.build() .build()
); );
...@@ -148,7 +148,7 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple ...@@ -148,7 +148,7 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple
WeGroupMember.builder() WeGroupMember.builder()
.chatId(kk.getChat_id()) .chatId(kk.getChat_id())
.userId(member.getUserid()) .userId(member.getUserid())
.joinTime(member.getJoin_time()) .joinTime(new Date(member.getJoin_time() * 1000L))
.joinScene(member.getJoin_scene()) .joinScene(member.getJoin_scene())
.joinType(member.getType()) .joinType(member.getType())
.unionId(member.getUnionid()) .unionId(member.getUnionid())
......
...@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="addWay" column="add_way" /> <result property="addWay" column="add_way" />
<result property="state" column="state" /> <result property="state" column="state" />
<result property="userName" column="user_name"/> <result property="userName" column="user_name"/>
<result property="department" column="department"/>
<collection property="weFlowerCustomerTagRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerTagRel"> <collection property="weFlowerCustomerTagRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerTagRel">
<result property="flowerCustomerRelId" column="flower_customer_rel_id" /> <result property="flowerCustomerRelId" column="flower_customer_rel_id" />
<result property="tagId" column="tag_id" /> <result property="tagId" column="tag_id" />
...@@ -64,7 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -64,7 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wfcrf.flower_customer_rel_id, wfcrf.flower_customer_rel_id,
wt.tag_id, wt.tag_id,
wt.create_time, wt.create_time,
wt.`name` as tagName wt.`name` as tagName,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
FROM FROM
we_customer wc we_customer wc
LEFT JOIN we_flower_customer_rel wfcr ON wc.external_userid=wfcr.external_userid LEFT JOIN we_flower_customer_rel wfcr ON wc.external_userid=wfcr.external_userid
......
...@@ -4,75 +4,31 @@ ...@@ -4,75 +4,31 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeGroupMemberMapper"> <mapper namespace="com.linkwechat.wecom.mapper.WeGroupMemberMapper">
<!-- <resultMap type="WeGroupMember" id="WeGroupMemberResult">-->
<!-- <result property="id" column="id" />-->
<!-- <result property="groupId" column="group_id" />-->
<!-- <result property="memberName" column="member_name" />-->
<!-- <result property="joinTime" column="join_time" />-->
<!-- <result property="joinType" column="join_type" />-->
<!-- </resultMap>-->
<!-- <sql id="selectWeGroupMemberVo">-->
<!-- select id, group_id, member_name, join_time, join_type from we_group_member-->
<!-- </sql>-->
<select id="selectWeGroupMemberList" parameterType="WeGroupMember" resultType="com.linkwechat.wecom.domain.WeGroupMember"> <select id="selectWeGroupMemberList" parameterType="WeGroupMember" resultType="com.linkwechat.wecom.domain.WeGroupMember">
SELECT SELECT
wc.`name` AS memberName,
wgm.join_time, wgm.join_time,
wgm.type wgm.type,
wgm.join_scene,
CASE
WHEN wgm.type=1 THEN
(
SELECT wu.user_name FROM we_user wu
WHERE wu.user_id=wgm.user_id
)
WHEN wgm.type = 2 THEN
(
SELECT wc.name FROM we_customer wc
WHERE wc.external_userid=wgm.user_id
)
END memberName
FROM FROM
we_group_member wgm we_group_member wgm
LEFT JOIN we_customer wc ON wgm.user_id=wc.external_userid
<where> <where>
<if test="chatId != null "> and wgm.chat_id = #{chatId}</if> <if test="chatId != null "> and wgm.chat_id = #{chatId}</if>
<if test="memberName != null and memberName != ''"> and wc.`name` like concat('%', #{memberName}, '%')</if> <if test="memberName != null and memberName != ''"> and HAVING wc.`name` like concat('%', #{memberName}, '%')</if>
</where> </where>
</select> </select>
<!-- <select id="selectWeGroupMemberById" parameterType="Long" resultMap="WeGroupMemberResult">-->
<!-- <include refid="selectWeGroupMemberVo"/>-->
<!-- where id = #{id}-->
<!-- </select>-->
<!-- <insert id="insertWeGroupMember" parameterType="WeGroupMember">-->
<!-- insert into we_group_member-->
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
<!-- <if test="id != null">id,</if>-->
<!-- <if test="groupId != null">group_id,</if>-->
<!-- <if test="memberName != null">member_name,</if>-->
<!-- <if test="joinTime != null">join_time,</if>-->
<!-- <if test="joinType != null">join_type,</if>-->
<!-- </trim>-->
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
<!-- <if test="id != null">#{id},</if>-->
<!-- <if test="groupId != null">#{groupId},</if>-->
<!-- <if test="memberName != null">#{memberName},</if>-->
<!-- <if test="joinTime != null">#{joinTime},</if>-->
<!-- <if test="joinType != null">#{joinType},</if>-->
<!-- </trim>-->
<!-- </insert>-->
<!-- <update id="updateWeGroupMember" parameterType="WeGroupMember">-->
<!-- update we_group_member-->
<!-- <trim prefix="SET" suffixOverrides=",">-->
<!-- <if test="groupId != null">group_id = #{groupId},</if>-->
<!-- <if test="memberName != null">member_name = #{memberName},</if>-->
<!-- <if test="joinTime != null">join_time = #{joinTime},</if>-->
<!-- <if test="joinType != null">join_type = #{joinType},</if>-->
<!-- </trim>-->
<!-- where id = #{id}-->
<!-- </update>-->
<!-- <delete id="deleteWeGroupMemberById" parameterType="Long">-->
<!-- delete from we_group_member where id = #{id}-->
<!-- </delete>-->
<!-- <delete id="deleteWeGroupMemberByIds" parameterType="String">-->
<!-- delete from we_group_member where id in-->
<!-- <foreach item="id" collection="array" open="(" separator="," close=")">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- </delete>-->
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -28,12 +28,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -28,12 +28,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectWeUserVo"> <sql id="selectWeUserVo">
select head_image_url as avatarMediaid, user_name, alias, user_id, gender, mobile, email, wx_account, department, position, is_leader_in_dept, join_time, enable, id_card, qq_account, telephone, address, birthday, remark from we_user select is_activate,head_image_url as avatarMediaid, user_name, alias, user_id, gender, mobile, email, wx_account, department, position, is_leader_in_dept, join_time, enable, id_card, qq_account, telephone, address, birthday, remark from we_user
</sql> </sql>
<select id="selectWeUserList" parameterType="WeUser" resultMap="WeUserResult"> <select id="selectWeUserList" parameterType="WeUser" resultMap="WeUserResult">
<include refid="selectWeUserVo"/> <include refid="selectWeUserVo"/>
<where> WHERE
is_activate !=6
<if test="avatarMediaid != null and avatarMediaid != ''"> and head_image_url = #{avatarMediaid}</if> <if test="avatarMediaid != null and avatarMediaid != ''"> and head_image_url = #{avatarMediaid}</if>
<if test="name != null and name != ''"> and user_name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and user_name like concat('%', #{name}, '%')</if>
<if test="alias != null and alias != ''"> and alias = #{alias}</if> <if test="alias != null and alias != ''"> and alias = #{alias}</if>
...@@ -42,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -42,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if> <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
<if test="email != null and email != ''"> and email = #{email}</if> <if test="email != null and email != ''"> and email = #{email}</if>
<if test="wxAccount != null and wxAccount != ''"> and wx_account = #{wxAccount}</if> <if test="wxAccount != null and wxAccount != ''"> and wx_account = #{wxAccount}</if>
<if test="department != null and department != ''"> and FIND_IN_SET(#{department},department)</if> <if test="department != null and department != '' and department != '1' "> and FIND_IN_SET(#{department},department)</if>
<if test="position != null and position != ''"> and position = #{position}</if> <if test="position != null and position != ''"> and position = #{position}</if>
<if test="isLeaderInDept != null "> and is_leader_in_dept = #{isLeaderInDept}</if> <if test="isLeaderInDept != null "> and is_leader_in_dept = #{isLeaderInDept}</if>
<if test="joinTime != null "> and join_time = #{joinTime}</if> <if test="joinTime != null "> and join_time = #{joinTime}</if>
...@@ -51,7 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -51,7 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if> <if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
<if test="address != null and address != ''"> and address = #{address}</if> <if test="address != null and address != ''"> and address = #{address}</if>
<if test="birthday != null "> and birthday = #{birthday}</if> <if test="birthday != null "> and birthday = #{birthday}</if>
</where>
</select> </select>
<select id="selectWeUserById" parameterType="Long" resultMap="WeUserResult"> <select id="selectWeUserById" parameterType="Long" resultMap="WeUserResult">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!