Commit 4cb3cfb2 by 墨竹

feat:企微安全改造修改

parent ac8cad91
...@@ -95,10 +95,6 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -95,10 +95,6 @@ public class WxEnterpriseDTO implements Serializable {
* 是否同意授权转换external_userid时间 * 是否同意授权转换external_userid时间
*/ */
private Date agreeExternalUseridTime; private Date agreeExternalUseridTime;
/**
* 是否使用代开发,1:是,0:否
*/
private Integer isCustomizedApp;
public String getMemberSecret() { public String getMemberSecret() {
return memberSecret; return memberSecret;
...@@ -428,11 +424,4 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -428,11 +424,4 @@ public class WxEnterpriseDTO implements Serializable {
this.agreeExternalUseridTime = agreeExternalUseridTime; this.agreeExternalUseridTime = agreeExternalUseridTime;
} }
public Integer getIsCustomizedApp() {
return isCustomizedApp;
}
public void setIsCustomizedApp(Integer isCustomizedApp) {
this.isCustomizedApp = isCustomizedApp;
}
} }
package com.gic.haoban.manage.service.dao.mapper; package com.gic.haoban.manage.service.dao.mapper;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.service.entity.TabHaobanWxApplication; import com.gic.haoban.manage.service.entity.TabHaobanWxApplication;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface WxApplicationMapper { public interface WxApplicationMapper {
int deleteByPrimaryKey(String wxApplicationId); int deleteByPrimaryKey(String wxApplicationId);
int insert(TabHaobanWxApplication record);
int insertSelective(TabHaobanWxApplication record); int insertSelective(TabHaobanWxApplication record);
TabHaobanWxApplication selectByPrimaryKey(String wxApplicationId); TabHaobanWxApplication selectByPrimaryKey(String wxApplicationId);
int updateByPrimaryKeySelective(TabHaobanWxApplication record); int updateByPrimaryKeySelective(TabHaobanWxApplication record);
int updateByPrimaryKey(TabHaobanWxApplication record);
TabHaobanWxApplication selectBySiteIdAndWxEnterpriseId(@Param("siteId")String siteId, @Param("wxEnterpriseId")String wxEnterpriseId); TabHaobanWxApplication selectBySiteIdAndWxEnterpriseId(@Param("siteId")String siteId, @Param("wxEnterpriseId")String wxEnterpriseId);
List<TabHaobanWxApplication> selectByWxEnterpriseIdAndApplicationType(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("applicationType")int applicationType); List<TabHaobanWxApplication> selectByWxEnterpriseIdAndApplicationType(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("applicationType")int applicationType);
......
...@@ -22,13 +22,29 @@ public interface WxEnterpriseMapper { ...@@ -22,13 +22,29 @@ public interface WxEnterpriseMapper {
@Param("version") String version, @Param("version") String version,
@Param("enterpriseIdsNotIn") List<String> enterpriseIdsNotIn); @Param("enterpriseIdsNotIn") List<String> enterpriseIdsNotIn);
List<TabHaobanWxEnterprise> listBycorpId(@Param("corpId") String corpId); List<TabHaobanWxEnterprise> listAll();
List<TabHaobanWxEnterprise> listDelBycorpId(@Param("corpId") String corpId);
List<TabHaobanWxEnterprise> listAll();
List<TabHaobanWxEnterprise> listByIds(@Param("enterpriseIds") Set<String> wxEnterpriseIds); List<TabHaobanWxEnterprise> listByIds(@Param("enterpriseIds") Set<String> wxEnterpriseIds);
List<TabHaobanWxEnterprise> getEnterpriseBycorpIdNoStatus(@Param("corpId")String corpId); /**
* 得到企业bycorpid
*
* @param corpId 公司标识
* @param statusFlag 状态标志
* @return {@link TabHaobanWxEnterprise }
* @author mozhu
* @date 2021-12-03 16:04:31
*/
TabHaobanWxEnterprise getEnterpriseBycorpId(@Param("corpId") String corpId, @Param("statusFlag") Integer statusFlag);
/**
* 根据openCorpid查询数据
*
* @param openCorpid
* @param statusFlag 状态标志
* @return {@link TabHaobanWxEnterprise }
* @author mozhu
* @date 2021-12-03 16:04:29
*/
TabHaobanWxEnterprise getEnterpriseByOpenCorpId(@Param("openCorpid") String openCorpid, @Param("statusFlag") Integer statusFlag);
} }
\ No newline at end of file
...@@ -9,6 +9,8 @@ public class TabHaobanWxApplication implements Serializable { ...@@ -9,6 +9,8 @@ public class TabHaobanWxApplication implements Serializable {
private String wxApplicationId; private String wxApplicationId;
private String corpid;
private String siteId; private String siteId;
private String name; private String name;
...@@ -129,4 +131,12 @@ public class TabHaobanWxApplication implements Serializable { ...@@ -129,4 +131,12 @@ public class TabHaobanWxApplication implements Serializable {
public void setIsCustomizedApp(Integer isCustomizedApp) { public void setIsCustomizedApp(Integer isCustomizedApp) {
this.isCustomizedApp = isCustomizedApp; this.isCustomizedApp = isCustomizedApp;
} }
public String getCorpid() {
return corpid;
}
public void setCorpid(String corpid) {
this.corpid = corpid;
}
} }
\ No newline at end of file
...@@ -75,10 +75,6 @@ public class TabHaobanWxEnterprise implements Serializable { ...@@ -75,10 +75,6 @@ public class TabHaobanWxEnterprise implements Serializable {
private Date updateTime; private Date updateTime;
/** /**
* 是否使用代开发,1:是,0:否
*/
private Integer isCustomizedApp;
/**
* 是否同意授权转换external_userid,1:是 * 是否同意授权转换external_userid,1:是
*/ */
private Integer agreeExternalUseridFlag; private Integer agreeExternalUseridFlag;
...@@ -87,7 +83,6 @@ public class TabHaobanWxEnterprise implements Serializable { ...@@ -87,7 +83,6 @@ public class TabHaobanWxEnterprise implements Serializable {
*/ */
private Date agreeExternalUseridTime; private Date agreeExternalUseridTime;
public String getMemberSecret() { public String getMemberSecret() {
return memberSecret; return memberSecret;
} }
...@@ -376,11 +371,4 @@ public class TabHaobanWxEnterprise implements Serializable { ...@@ -376,11 +371,4 @@ public class TabHaobanWxEnterprise implements Serializable {
this.agreeExternalUseridTime = agreeExternalUseridTime; this.agreeExternalUseridTime = agreeExternalUseridTime;
} }
public Integer getIsCustomizedApp() {
return isCustomizedApp;
}
public void setIsCustomizedApp(Integer isCustomizedApp) {
this.isCustomizedApp = isCustomizedApp;
}
} }
\ No newline at end of file
...@@ -20,9 +20,11 @@ public interface WxEnterpriseService { ...@@ -20,9 +20,11 @@ public interface WxEnterpriseService {
/** /**
* 通过微信企业ID查询删除状态好办企业ID * 通过微信企业ID查询删除状态好办企业ID
*
* @param corpId * @param corpId
* @return * @return
*/ */
@Deprecated
TabHaobanWxEnterprise getDelEnterpriseBycorpId(String corpId); TabHaobanWxEnterprise getDelEnterpriseBycorpId(String corpId);
void update(WxEnterpriseDTO enterpriseDTO); void update(WxEnterpriseDTO enterpriseDTO);
......
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import java.util.Date;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.haoban.common.utils.StringUtil; import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper; import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service @Service
public class WxEnterpriseServiceImpl implements WxEnterpriseService { public class WxEnterpriseServiceImpl implements WxEnterpriseService {
@Autowired @Autowired
WxEnterpriseMapper mapper; private WxEnterpriseMapper mapper;
@Autowired
private QywxUserApiService qywxUserApiService;
@Override @Override
public String add(WxEnterpriseDTO wxDTO) { public String add(WxEnterpriseDTO wxDTO) {
Date now = new Date(); Date now = new Date();
wxDTO.setWxEnterpriseId(StringUtil.randomUUID()); wxDTO.setWxEnterpriseId(StringUtil.randomUUID());
wxDTO.setCreateTime(now); wxDTO.setCreateTime(now);
wxDTO.setUpdateTime(now); wxDTO.setUpdateTime(now);
TabHaobanWxEnterprise tabHaobanWxEnterprise = EntityUtil.changeEntityByJSON(TabHaobanWxEnterprise.class, wxDTO); TabHaobanWxEnterprise tabHaobanWxEnterprise = EntityUtil.changeEntityByJSON(TabHaobanWxEnterprise.class, wxDTO);
tabHaobanWxEnterprise.setStatusFlag(1); tabHaobanWxEnterprise.setStatusFlag(1);
tabHaobanWxEnterprise.setBindFlag(1); tabHaobanWxEnterprise.setBindFlag(1);
mapper.insertSelective(tabHaobanWxEnterprise); mapper.insertSelective(tabHaobanWxEnterprise);
return wxDTO.getWxEnterpriseId(); return wxDTO.getWxEnterpriseId();
}
@Override }
public WxEnterpriseDTO selectById(String wxEnterpriseId) {
return EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, mapper.selectByPrimaryKey(wxEnterpriseId));
}
@Override @Override
public TabHaobanWxEnterprise getEnterpriseBycorpId(String corpId) { public WxEnterpriseDTO selectById(String wxEnterpriseId) {
List<TabHaobanWxEnterprise> list = this.mapper.listBycorpId(corpId); return EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, mapper.selectByPrimaryKey(wxEnterpriseId));
if(CollectionUtils.isNotEmpty(list)){ }
return list.get(0);
}
return null;
}
@Override @Override
public TabHaobanWxEnterprise getDelEnterpriseBycorpId(String corpId) { public TabHaobanWxEnterprise getEnterpriseBycorpId(String corpId) {
List<TabHaobanWxEnterprise> list = this.mapper.listDelBycorpId(corpId); return mapper.getEnterpriseBycorpId(corpId, 1);
if(CollectionUtils.isNotEmpty(list)){ }
return list.get(0);
}
return null;
}
@Override @Override
public void update(WxEnterpriseDTO enterpriseDTO) { public TabHaobanWxEnterprise getDelEnterpriseBycorpId(String corpId) {
enterpriseDTO.setUpdateTime(new Date()); return mapper.getEnterpriseBycorpId(corpId, 0);
mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanWxEnterprise.class, enterpriseDTO)); }
}
@Override @Override
public int delete(String wxEnterpriseId) { public void update(WxEnterpriseDTO enterpriseDTO) {
TabHaobanWxEnterprise enterprise = new TabHaobanWxEnterprise(); enterpriseDTO.setUpdateTime(new Date());
enterprise.setWxEnterpriseId(wxEnterpriseId); mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanWxEnterprise.class, enterpriseDTO));
enterprise.setStatusFlag(0); }
@Override
public int delete(String wxEnterpriseId) {
TabHaobanWxEnterprise enterprise = new TabHaobanWxEnterprise();
enterprise.setWxEnterpriseId(wxEnterpriseId);
enterprise.setStatusFlag(0);
enterprise.setUpdateTime(new Date()); enterprise.setUpdateTime(new Date());
return this.mapper.updateByPrimaryKeySelective(enterprise); return this.mapper.updateByPrimaryKeySelective(enterprise);
} }
@Override @Override
public int unbind(String wxEnterpriseId) { public int unbind(String wxEnterpriseId) {
TabHaobanWxEnterprise enterprise = new TabHaobanWxEnterprise(); TabHaobanWxEnterprise enterprise = new TabHaobanWxEnterprise();
enterprise.setWxEnterpriseId(wxEnterpriseId); enterprise.setWxEnterpriseId(wxEnterpriseId);
...@@ -82,16 +75,11 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService { ...@@ -82,16 +75,11 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
@Override @Override
public TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpId) { public TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpId) {
List<TabHaobanWxEnterprise> list = this.mapper.getEnterpriseBycorpIdNoStatus(corpId); return this.mapper.getEnterpriseBycorpId(corpId, null);
if (CollectionUtils.isNotEmpty(list)) {
return list.get(0);
}
return null;
} }
@Override @Override
public List<TabHaobanWxEnterprise> listAll() { public List<TabHaobanWxEnterprise> listAll() {
List<TabHaobanWxEnterprise> ret = mapper.listAll(); return mapper.listAll();
return ret;
} }
} }
...@@ -65,18 +65,22 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -65,18 +65,22 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
String userId = dto.getUserid(); String userId = dto.getUserid();
Integer isCustomizedApp = dto.getIsCustomizedApp(); Integer isCustomizedApp = dto.getIsCustomizedApp();
WxEnterpriseDTO wxDTO = EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, dto); WxEnterpriseDTO wxDTO = EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, dto);
TabHaobanWxEnterprise enterprise = this.wxEnterpriseService.getEnterpriseBycorpIdNoStatus(corpid);
String wxEnterpriseId = ""; String wxEnterpriseId = "";
if (enterprise != null) { //授权好办小程序
wxEnterpriseId = enterprise.getWxEnterpriseId(); if (isCustomizedApp == null || isCustomizedApp != 1) {
wxDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId()); //只需要插入好办小程序企业
wxDTO.setStatusFlag(1); TabHaobanWxEnterprise enterprise = this.wxEnterpriseService.getEnterpriseBycorpIdNoStatus(corpid);
wxDTO.setBindFlag(1); if (enterprise != null) {
wxDTO.setIsCustomizedApp(isCustomizedApp); wxEnterpriseId = enterprise.getWxEnterpriseId();
wxEnterpriseService.update(wxDTO); wxDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId());
} else { wxDTO.setStatusFlag(1);
wxEnterpriseId = wxEnterpriseService.add(wxDTO); wxDTO.setBindFlag(1);
wxEnterpriseService.update(wxDTO);
} else {
wxEnterpriseId = wxEnterpriseService.add(wxDTO);
}
} }
if (StringUtils.isNotBlank(userId)) { if (StringUtils.isNotBlank(userId)) {
staffApiService.wxGetAdd(userId, wxEnterpriseId); staffApiService.wxGetAdd(userId, wxEnterpriseId);
} }
...@@ -85,6 +89,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -85,6 +89,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
if (tab == null) { if (tab == null) {
tab = new TabHaobanWxApplication(); tab = new TabHaobanWxApplication();
tab.setAgentId(agentId); tab.setAgentId(agentId);
tab.setCorpid(corpid);
tab.setSiteId(siteId); tab.setSiteId(siteId);
tab.setAgentName(agentName); tab.setAgentName(agentName);
tab.setName(applicationName); tab.setName(applicationName);
...@@ -159,12 +164,11 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -159,12 +164,11 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
if (StringUtils.isEmpty(enterpriseId)) { if (StringUtils.isEmpty(enterpriseId)) {
return true; return true;
} }
EnterpriseDTO enterprise = enterpriseService.getEnterpriseByEid(enterpriseId); EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(enterpriseId);
if (enterprise == null || enterprise.getExpireTime() == null) { if (enterprise == null || enterprise.getExpireTime() == null) {
return true; return true;
} }
return enterprise.getExpireTime().getTime() <= System.currentTimeMillis(); return enterprise.getExpireTime().getTime() <= System.currentTimeMillis();
} }
@Override @Override
......
...@@ -19,27 +19,20 @@ ...@@ -19,27 +19,20 @@
wx_application_id, site_id, name, permanent_code, agent_name, agent_id, application_type, wx_application_id, site_id, name, permanent_code, agent_name, agent_id, application_type,
wx_enterprise_id, status_flag, create_time, update_time,is_customized_app wx_enterprise_id, status_flag, create_time, update_time,is_customized_app
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_wx_application from tab_haoban_wx_application
where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR} where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete delete
from tab_haoban_wx_application from tab_haoban_wx_application
where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR} where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR}
</delete> </delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxApplication">
insert into tab_haoban_wx_application (wx_application_id, site_id, name,
permanent_code, agent_name, agent_id,
application_type, wx_enterprise_id, status_flag,
create_time, update_time, is_customized_app)
values (#{wxApplicationId,jdbcType=VARCHAR}, #{siteId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{permanentCode,jdbcType=VARCHAR}, #{agentName,jdbcType=VARCHAR}, #{agentId,jdbcType=VARCHAR},
#{applicationType,jdbcType=INTEGER}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isCustomizedApp,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxApplication"> <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxApplication">
insert into tab_haoban_wx_application insert into tab_haoban_wx_application
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -159,21 +152,6 @@ ...@@ -159,21 +152,6 @@
</set> </set>
where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR} where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxApplication">
update tab_haoban_wx_application
set site_id = #{siteId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
permanent_code = #{permanentCode,jdbcType=VARCHAR},
agent_name = #{agentName,jdbcType=VARCHAR},
agent_id = #{agentId,jdbcType=VARCHAR},
application_type = #{applicationType,jdbcType=INTEGER},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_customized_app = #{isCustomizedApp,jdbcType=INTEGER}
where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR}
</update>
<select id="selectBySiteIdAndWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectBySiteIdAndWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
<result column="agree_external_userid_flag" property="agreeExternalUseridFlag" jdbcType="INTEGER"/> <result column="agree_external_userid_flag" property="agreeExternalUseridFlag" jdbcType="INTEGER"/>
<result column="agree_external_userid_time" property="agreeExternalUseridTime" jdbcType="TIMESTAMP"/> <result column="agree_external_userid_time" property="agreeExternalUseridTime" jdbcType="TIMESTAMP"/>
<result column="is_customized_app" property="isCustomizedApp" jdbcType="INTEGER"/> <result column="is_customized_app" property="isCustomizedApp" jdbcType="INTEGER"/>
<result column="open_corpid" property="openCorpid" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -46,7 +47,7 @@ ...@@ -46,7 +47,7 @@
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale, corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale,
corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name, corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name,
square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key,wx_secret_key_last_time,member_secret_last_time,contact_secret_last_time square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key,wx_secret_key_last_time,member_secret_last_time,contact_secret_last_time
,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,is_customized_app ,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,is_customized_app,open_corpid
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
...@@ -162,6 +163,9 @@ ...@@ -162,6 +163,9 @@
<if test="isCustomizedApp != null"> <if test="isCustomizedApp != null">
is_customized_app, is_customized_app,
</if> </if>
<if test="openCorpid != null">
open_corpid,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wxEnterpriseId != null"> <if test="wxEnterpriseId != null">
...@@ -263,6 +267,9 @@ ...@@ -263,6 +267,9 @@
<if test="isCustomizedApp != null"> <if test="isCustomizedApp != null">
#{isCustomizedApp,jdbcType=INTEGER}, #{isCustomizedApp,jdbcType=INTEGER},
</if> </if>
<if test="openCorpid != null">
#{openCorpid,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise"> <update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise">
...@@ -376,6 +383,9 @@ ...@@ -376,6 +383,9 @@
<if test="isCustomizedApp != null"> <if test="isCustomizedApp != null">
is_customized_app = #{isCustomizedApp,jdbcType=INTEGER}, is_customized_app = #{isCustomizedApp,jdbcType=INTEGER},
</if> </if>
<if test="openCorpid != null">
open_corpid = #{openCorpid,jdbcType=VARCHAR},
</if>
</set> </set>
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</update> </update>
...@@ -419,14 +429,8 @@ ...@@ -419,14 +429,8 @@
</foreach> </foreach>
</if> </if>
</if> </if>
</select>
<select id="listBycorpId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_wx_enterprise
where status_flag = 1 and corpid= #{corpId}
</select> </select>
<select id="listDelBycorpId" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="listDelBycorpId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
...@@ -454,10 +458,26 @@ ...@@ -454,10 +458,26 @@
</if> </if>
</select> </select>
<select id="getEnterpriseBycorpIdNoStatus" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="getEnterpriseBycorpId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_wx_enterprise from tab_haoban_wx_enterprise
where corpid= #{corpId} where corpid= #{corpId}
<if test="statusFlag != null">
and status_flag = #{statusFlag}
</if>
limit 1
</select>
<select id="getEnterpriseByOpenCorpId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_wx_enterprise
where open_corpid= #{openCorpid}
<if test="statusFlag != null">
and status_flag = #{statusFlag}
</if>
limit 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment