Commit 4ec4f207 by pansy

aaa

parent a6592170
package com.pcloud.book.applet.biz;
import com.pcloud.book.applet.entity.AppletBusinessCard;
import com.pcloud.common.page.PageBeanNew;
/**
* Created with IntelliJ IDEA.
*
* @Auther: Pansy
* @Date: 2020/07/29/10:32
* @Description:
*/
public interface AppletBusinessCardBiz {
Long insert(AppletBusinessCard appletBusinessCard);
void deleteById(Long id);
void update(AppletBusinessCard appletBusinessCard);
/**
* 分页查询
*/
PageBeanNew getList(String keyword, Integer currentPage, Integer numPerPage);
}
package com.pcloud.book.applet.biz.impl;
import com.google.common.collect.Lists;
import com.pcloud.book.applet.biz.AppletBusinessCardBiz;
import com.pcloud.book.applet.dao.AppletBusinessCardDao;
import com.pcloud.book.applet.dao.AppletNewsDao;
import com.pcloud.book.applet.dto.AppletGroupManageDTO;
import com.pcloud.book.applet.entity.AppletBusinessCard;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.dao.BookRaysClassifyDao;
import com.pcloud.book.group.vo.ClassifyQrcodeVO;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.string.StringUtilParent;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
/**
* Created with IntelliJ IDEA.
*
* @Auther: Pansy
* @Date: 2020/07/29/10:32
* @Description:
*/
@Service("appletBusinessCardBiz")
public class AppletBusinessCardBizImpl implements AppletBusinessCardBiz {
@Autowired
private AppletBusinessCardDao appletBusinessCardDao;
@Autowired
private AppletNewsDao appletNewsDao;
@Override
public Long insert(AppletBusinessCard appletBusinessCard){
return appletBusinessCardDao.insert(appletBusinessCard);
}
@Override
public void deleteById(Long id){
// if (appletNewsDao.getCountByBusinessCardId(id)>0){
// throw new BookBizException(BookBizException.ERROR, "名片已绑定咨询不能删除");
// }
appletBusinessCardDao.deleteById(id);
}
@Override
public void update(AppletBusinessCard appletBusinessCard){
appletBusinessCardDao.update(appletBusinessCard);
}
@Override
public PageBeanNew getList(String keyword,Integer currentPage, Integer numPerPage){
Map<String,Object> map = new HashMap<>();
map.put("keyword", keyword);
PageBeanNew<AppletBusinessCard> recordList = appletBusinessCardDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getList");
if (null == recordList || CollectionUtils.isEmpty(recordList.getRecordList())) {
return recordList;
}
return recordList;
}
}
...@@ -6,6 +6,7 @@ import com.pcloud.appcenter.assist.dto.AssistTempletDTO; ...@@ -6,6 +6,7 @@ import com.pcloud.appcenter.assist.dto.AssistTempletDTO;
import com.pcloud.book.applet.biz.AppletNewsBiz; import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.biz.AppletUserBookcaseBiz; import com.pcloud.book.applet.biz.AppletUserBookcaseBiz;
import com.pcloud.book.applet.contants.AppletConstants; import com.pcloud.book.applet.contants.AppletConstants;
import com.pcloud.book.applet.dao.AppletBusinessCardDao;
import com.pcloud.book.applet.dao.AppletLinkClickDao; import com.pcloud.book.applet.dao.AppletLinkClickDao;
import com.pcloud.book.applet.dao.AppletNewsClassifyDao; import com.pcloud.book.applet.dao.AppletNewsClassifyDao;
import com.pcloud.book.applet.dao.AppletNewsCommentDao; import com.pcloud.book.applet.dao.AppletNewsCommentDao;
...@@ -19,6 +20,7 @@ import com.pcloud.book.applet.dto.AppletNewsDTO; ...@@ -19,6 +20,7 @@ import com.pcloud.book.applet.dto.AppletNewsDTO;
import com.pcloud.book.applet.dto.AppletNewsServeDTO; import com.pcloud.book.applet.dto.AppletNewsServeDTO;
import com.pcloud.book.applet.dto.AppletNewsVO; import com.pcloud.book.applet.dto.AppletNewsVO;
import com.pcloud.book.applet.dto.PvuvDTO; import com.pcloud.book.applet.dto.PvuvDTO;
import com.pcloud.book.applet.entity.AppletBusinessCard;
import com.pcloud.book.applet.entity.AppletLinkClick; import com.pcloud.book.applet.entity.AppletLinkClick;
import com.pcloud.book.applet.entity.AppletNews; import com.pcloud.book.applet.entity.AppletNews;
import com.pcloud.book.applet.entity.AppletNewsClassify; import com.pcloud.book.applet.entity.AppletNewsClassify;
...@@ -96,6 +98,8 @@ public class AppletNewsBizImpl implements AppletNewsBiz { ...@@ -96,6 +98,8 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
private AppletUserBookcaseBiz appletUserBookcaseBiz; private AppletUserBookcaseBiz appletUserBookcaseBiz;
@Autowired @Autowired
private AppletUserBookcaseDao appletUserBookcaseDao; private AppletUserBookcaseDao appletUserBookcaseDao;
@Autowired
private AppletBusinessCardDao appletBusinessCardDao;
@Override @Override
public Long addAppletNewsClassify(AppletNewsClassify appletNewsClassify) { public Long addAppletNewsClassify(AppletNewsClassify appletNewsClassify) {
...@@ -140,6 +144,12 @@ public class AppletNewsBizImpl implements AppletNewsBiz { ...@@ -140,6 +144,12 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
if (urlNumberExist(appletNews)){ if (urlNumberExist(appletNews)){
throw new BookBizException(BookBizException.ERROR,"链接编号重复"); throw new BookBizException(BookBizException.ERROR,"链接编号重复");
} }
if(appletNews.getBusinessCardType()!= null && appletNews.getBusinessCardType()==0){
AppletBusinessCard appletBusinessCard = new AppletBusinessCard();
BeanUtils.copyProperties(appletNews,appletBusinessCard);
Long businessId = appletBusinessCardDao.insert(appletBusinessCard);
appletNews.setBusinessCardId(businessId);
}
appletNews.setShowState(false); appletNews.setShowState(false);
rightsSettingBiz.setClassifyAndLabel(appletNews); rightsSettingBiz.setClassifyAndLabel(appletNews);
appletNewsDao.insert(appletNews); appletNewsDao.insert(appletNews);
...@@ -197,6 +207,17 @@ public class AppletNewsBizImpl implements AppletNewsBiz { ...@@ -197,6 +207,17 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
if (urlNumberExist(appletNews)){ if (urlNumberExist(appletNews)){
throw new BookBizException(BookBizException.ERROR,"链接编号重复"); throw new BookBizException(BookBizException.ERROR,"链接编号重复");
} }
if(appletNews.getBusinessCardType()!= null && appletNews.getBusinessCardType()==0){
AppletBusinessCard appletBusinessCard = new AppletBusinessCard();
BeanUtils.copyProperties(appletNews,appletBusinessCard);
if (appletNews.getBusinessCardId() == null){
Long businessId = appletBusinessCardDao.insert(appletBusinessCard);
appletNews.setBusinessCardId(businessId);
}else {
appletBusinessCard.setId(appletNews.getBusinessCardId());
Long businessId = appletBusinessCardDao.update(appletBusinessCard);
}
}
AppletNews beforeNews = appletNewsDao.getById(appletNews.getId()); AppletNews beforeNews = appletNewsDao.getById(appletNews.getId());
rightsSettingBiz.setClassifyAndLabel(appletNews); rightsSettingBiz.setClassifyAndLabel(appletNews);
appletNewsDao.update(appletNews); appletNewsDao.update(appletNews);
...@@ -439,9 +460,28 @@ public class AppletNewsBizImpl implements AppletNewsBiz { ...@@ -439,9 +460,28 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
this.fillAppletNewsServe(appletNewsDTO); this.fillAppletNewsServe(appletNewsDTO);
this.fillBrowseCount(Lists.newArrayList(appletNewsDTO)); this.fillBrowseCount(Lists.newArrayList(appletNewsDTO));
fillLabel(Arrays.asList(appletNewsDTO)); fillLabel(Arrays.asList(appletNewsDTO));
fillBusinessCard(appletNewsDTO);
return appletNewsDTO; return appletNewsDTO;
} }
private void fillBusinessCard(AppletNewsDTO appletNewsDTO){
if(null != appletNewsDTO.getBusinessCardId()){
AppletBusinessCard appletBusinessCard = appletBusinessCardDao.getById(appletNewsDTO.getBusinessCardId());
if (appletBusinessCard == null){
appletNewsDTO.setBusinessCardId(null);
return;
}
appletNewsDTO.setBusinessCardHeadPhoto(appletBusinessCard.getHeadPhoto());
appletNewsDTO.setBusinessCardName(appletBusinessCard.getName());
appletNewsDTO.setBusinessCardQrcode(appletBusinessCard.getQrcode());
appletNewsDTO.setBusinessCardTitle(appletBusinessCard.getTitle());
appletNewsDTO.setBusinessCardWechatNum(appletBusinessCard.getWechatNum());
appletNewsDTO.setBusinessPhone(appletBusinessCard.getPhone());
}
}
/** /**
* 点击量浏览量 * 点击量浏览量
* * @param null * * @param null
......
package com.pcloud.book.applet.dao;
import com.pcloud.book.applet.entity.AppletBusinessCard;
import com.pcloud.common.core.dao.BaseDao;
/**
* 小程序资讯
*/
public interface AppletBusinessCardDao extends BaseDao<AppletBusinessCard> {
Long getCountByName(String name);
}
...@@ -16,6 +16,13 @@ import java.util.Map; ...@@ -16,6 +16,13 @@ import java.util.Map;
*/ */
public interface AppletNewsDao extends BaseDao<AppletNews> { public interface AppletNewsDao extends BaseDao<AppletNews> {
/**
* 根据名片id获取是否已经绑定微信
* @param businessCardId
* @return
*/
Long getCountByBusinessCardId(Long businessCardId);
/** /**
* 根据分类查询 * 根据分类查询
......
package com.pcloud.book.applet.dao.impl;
import com.pcloud.book.applet.dao.AppletBusinessCardDao;
import com.pcloud.book.applet.entity.AppletBusinessCard;
import com.pcloud.common.core.dao.BaseDaoImpl;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Component;
/**
* Created with IntelliJ IDEA.
*
* @Auther: Pansy
* @Date: 2020/07/29/10:26
* @Description:
*/
@Component("appletBusinessCardDao")
public class AppletBusinessCardDaoImpl extends BaseDaoImpl<AppletBusinessCard> implements AppletBusinessCardDao {
public Long getCountByName(String name){
Map<String,Object> map = new HashMap<>();
map.put("name",name);
return super.getSqlSession().selectOne(getStatement("getCountByName"),map);
}
}
...@@ -21,6 +21,15 @@ import java.util.Map; ...@@ -21,6 +21,15 @@ import java.util.Map;
@Component @Component
public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements AppletNewsDao { public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements AppletNewsDao {
/**
* 根据名片id获取是否已经绑定微信
* @param businessCardId
* @return
*/
public Long getCountByBusinessCardId(Long businessCardId){
return getSessionTemplate().selectOne(getStatement("getCountByBusinessCardId"), businessCardId);
}
@Override @Override
public List<AppletNews> getByNewsClassifyId(Long newsClassifyId) { public List<AppletNews> getByNewsClassifyId(Long newsClassifyId) {
return getSessionTemplate().selectList(getStatement("getByNewsClassifyId"), newsClassifyId); return getSessionTemplate().selectList(getStatement("getByNewsClassifyId"), newsClassifyId);
......
...@@ -102,4 +102,22 @@ public class AppletNewsDTO extends BaseDto { ...@@ -102,4 +102,22 @@ public class AppletNewsDTO extends BaseDto {
List<AppletNewsServeDTO> appletNewsServeList; List<AppletNewsServeDTO> appletNewsServeList;
@ApiModelProperty("文章版式(1多图文2单图文3纯图片4纯文本)") @ApiModelProperty("文章版式(1多图文2单图文3纯图片4纯文本)")
private Integer newsType; private Integer newsType;
@ApiModelProperty("名片id")
private Long businessCardId;
@ApiModelProperty("类型: 0默认 1指定名片")
private Long businessCardType;
@ApiModelProperty("类型: 0关 1开")
private Long businessCardIsOpen;
@ApiModelProperty("名片名称")
private String businessCardName;
@ApiModelProperty("名片头衔")
private String businessCardTitle;
@ApiModelProperty("名片头像")
private String businessCardHeadPhoto;
@ApiModelProperty("名片二维码")
private String businessCardQrcode;
@ApiModelProperty("名片微信号")
private String businessCardWechatNum;
@ApiModelProperty("名片电话")
private String businessPhone;
} }
package com.pcloud.book.applet.entity;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.List;
import javax.validation.constraints.NotNull;
import jdk.nashorn.internal.objects.annotations.Property;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@Data
@ApiModel("小程序名片管理")
public class AppletBusinessCard extends BaseTempletClassify {
private static final long serialVersionUID = 6564866177995663454L;
@ApiModelProperty("主键")
private Long id;
@ApiModelProperty("姓名")
@NotNull(message = "姓名不能为空")
private String name;
@ApiModelProperty("头衔")
@NotNull(message = "头衔不能为空")
private String title;
@ApiModelProperty("二维码")
private String qrcode;
@ApiModelProperty("头像")
private String headPhoto;
@ApiModelProperty("微信号")
private String wechatNum;
@ApiModelProperty("电话")
@Length(min = 0,max = 11,message = "电话号码最多11位")
private String phone;
@ApiModelProperty("创建人")
private Long creator;
@ApiModelProperty("修改人")
private Long updator;
}
package com.pcloud.book.applet.entity; package com.pcloud.book.applet.entity;
import javax.validation.constraints.NotNull;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify; import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import com.pcloud.common.entity.BaseEntity; import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -8,6 +10,8 @@ import lombok.Data; ...@@ -8,6 +10,8 @@ import lombok.Data;
import java.util.List; import java.util.List;
import org.hibernate.validator.constraints.Length;
@Data @Data
@ApiModel("小程序资讯") @ApiModel("小程序资讯")
public class AppletNews extends BaseTempletClassify { public class AppletNews extends BaseTempletClassify {
...@@ -60,6 +64,40 @@ public class AppletNews extends BaseTempletClassify { ...@@ -60,6 +64,40 @@ public class AppletNews extends BaseTempletClassify {
private Integer showSource; private Integer showSource;
@ApiModelProperty("展示第三方资源") @ApiModelProperty("展示第三方资源")
private Integer showLink; private Integer showLink;
@ApiModelProperty("名片id")
private Long businessCardId;
@ApiModelProperty("类型: 0默认 1指定名片")
private Long businessCardType;
@ApiModelProperty("类型: 0关 1开")
private Long businessCardIsOpen;
@ApiModelProperty("姓名")
@NotNull(message = "姓名不能为空")
private String name;
@ApiModelProperty("头衔")
@NotNull(message = "头衔不能为空")
private String title;
@ApiModelProperty("二维码")
private String qrcode;
@ApiModelProperty("头像")
private String headPhoto;
@ApiModelProperty("微信号")
private String wechatNum;
@ApiModelProperty("电话")
@Length(min = 0,max = 11,message = "电话号码最多11位")
private String phone;
@ApiModelProperty("创建人")
private Long creator;
@ApiModelProperty("修改人")
private Long updator;
@ApiModelProperty("选取的服务") @ApiModelProperty("选取的服务")
List<AppletNewsServe> appletNewsServeList; List<AppletNewsServe> appletNewsServeList;
......
package com.pcloud.book.applet.facade;
import com.pcloud.book.applet.biz.AppletBusinessCardBiz;
import com.pcloud.book.applet.entity.AppletBusinessCard;
import com.pcloud.book.applet.entity.AppletNewsServe;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.SessionUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
*
* @author
* @since
*/
@RestController("appletBusinessCardFacade")
@RequestMapping("appletBusinessCard")
public class AppletBusinessCardFacade {
@Autowired
private AppletBusinessCardBiz appletBusinessCardBiz;
@ApiOperation("分页查询")
@GetMapping("getList")
public ResponseDto<?> getList(@RequestHeader("token") String token,
@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "currentPage", defaultValue = "0") Integer currentPage,
@RequestParam(value = "numPerPage", defaultValue = "10") Integer numPerPage)
throws BizException, PermissionException {
SessionUtil.getToken4Redis(token);
return new ResponseDto<>(appletBusinessCardBiz.getList(keyword,currentPage, numPerPage));
}
@ApiOperation("新增")
@PostMapping("insert")
public ResponseDto<?> insert(@RequestHeader("token") String token, @RequestBody AppletBusinessCard appletBusinessCard)
throws BizException, PermissionException {
SessionUtil.getToken4Redis(token);
return new ResponseDto<>(appletBusinessCardBiz.insert(appletBusinessCard));
}
@ApiOperation("更新")
@PostMapping("update")
public ResponseDto<?> update(@RequestHeader("token") String token,@RequestBody AppletBusinessCard appletBusinessCard) throws BizException, PermissionException {
SessionUtil.getToken4Redis(token);
appletBusinessCardBiz.update(appletBusinessCard);
return new ResponseDto<>();
}
@ApiOperation("删除")
@GetMapping("deleteById")
public ResponseDto<?> deleteById(@RequestHeader("token") String token, @RequestParam Long id) throws BizException, PermissionException {
SessionUtil.getToken4Redis(token);
if (null == id) {
throw BookBizException.PARAM_DELETION;
}
appletBusinessCardBiz.deleteById(id);
return new ResponseDto<>();
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.applet.dao.impl.AppletBusinessCardDaoImpl" >
<resultMap id="BaseResultMap" type="com.pcloud.book.applet.entity.AppletBusinessCard" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="title" property="title" jdbcType="VARCHAR" />
<result column="qrcode" property="qrcode" jdbcType="VARCHAR" />
<result column="head_photo" property="headPhoto" jdbcType="VARCHAR" />
<result column="wechat_num" property="wechatNum" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="creator" property="creator" jdbcType="BIGINT"/>
<result column="updator" property="updator" jdbcType="BIGINT"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List" >
id, name, title, qrcode, head_photo, wechat_num, phone ,creator,updator,create_time,update_time
</sql>
<insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletBusinessCard" useGeneratedKeys="true" keyProperty="id">
insert into applet_businessCard(
`name`, title, qrcode, head_photo, wechat_num, phone,create_time,update_time,creator,updator)
values (
#{name}, #{title}, #{qrcode}, #{headPhoto}, #{wechatNum}, #{phone},NOW(),NOW(), #{creator, jdbcType=BIGINT},#{updator, jdbcType=BIGINT}
)
</insert>
<delete id="deleteById" parameterType="long">
delete from applet_businessCard
where id=#{id}
</delete>
<update id="update" parameterType="com.pcloud.book.applet.entity.AppletBusinessCard">
update applet_businessCard
<set>
name = #{name},
title = #{title},
qrcode = #{qrcode},
head_photo = #{headPhoto},
wechat_num = #{wechatNum},
phone = #{phone},
update_time=NOW(),
updator =#{updator},
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<select id="getList" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM
applet_businessCard
WHERE 1=1
<if test="keyword!=null">
AND (name like concat('%', #{keyword}, '%') OR wechat_num like concat('%', #{keyword}, '%') OR phone like concat('%', #{keyword}, '%'))
</if>
ORDER BY update_time DESC
</select>
<select id="getCountByName" resultType="Integer" parameterType="String">
select
count(1) groupCount
from
applet_businessCard
where
name = #{name}
</select>
<!--根据id查询-->
<select id="getById" parameterType="Long" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from applet_businessCard where id=#{id}
</select>
</mapper>
...@@ -29,25 +29,28 @@ ...@@ -29,25 +29,28 @@
<result column="custom_tag_id" property="customTagId" jdbcType="BIGINT" /> <result column="custom_tag_id" property="customTagId" jdbcType="BIGINT" />
<result column="show_source" property="showSource" jdbcType="INTEGER" /> <result column="show_source" property="showSource" jdbcType="INTEGER" />
<result column="show_link" property="showLink" jdbcType="INTEGER" /> <result column="show_link" property="showLink" jdbcType="INTEGER" />
<result column="business_card_id" property="businessCardId" jdbcType="BIGINT" />
<result column="business_card_type" property="businessCardType" jdbcType="TINYINT" />
<result column="business_card_isOpen" property="businessCardIsOpen" jdbcType="TINYINT" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest, id, news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest,
pic1, pic2, pic3, content, show_state, create_time, update_time, first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id, pic1, pic2, pic3, content, show_state, create_time, update_time, first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id,
jump_type, jump_url, url_number, custom_tag_id, show_source, show_link jump_type, jump_url, url_number, custom_tag_id, show_source, show_link,business_card_id,business_card_type,business_card_isOpen
</sql> </sql>
<insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletNews" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletNews" useGeneratedKeys="true" keyProperty="id">
insert into applet_news( insert into applet_news(
news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest, news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest,
pic1, pic2, pic3, content, show_state, create_time, update_time , first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id, pic1, pic2, pic3, content, show_state, create_time, update_time , first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id,
jump_type, jump_url,url_number, custom_tag_id, show_source, show_link jump_type, jump_url,url_number, custom_tag_id, show_source, show_link,business_card_id,business_card_type,business_card_isOpen
) )
values ( values (
#{newsName}, #{source}, #{newsClassifyId}, #{proLabelId}, #{depLabelId}, #{purLabelId}, #{type}, #{digest}, #{newsName}, #{source}, #{newsClassifyId}, #{proLabelId}, #{depLabelId}, #{purLabelId}, #{type}, #{digest},
#{pic1}, #{pic2}, #{pic3}, #{content}, #{showState}, NOW(), NOW(), #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT}, #{pic1}, #{pic2}, #{pic3}, #{content}, #{showState}, NOW(), NOW(), #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{rightsClassifyId,jdbcType=BIGINT}, #{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{rightsClassifyId,jdbcType=BIGINT},
#{jumpType}, #{jumpUrl}, #{urlNumber}, #{customTagId}, #{showSource}, #{showLink} #{jumpType}, #{jumpUrl}, #{urlNumber}, #{customTagId}, #{showSource}, #{showLink}, #{businessCardId}, #{businessCardType}, #{businessCardIsOpen}
) )
</insert> </insert>
...@@ -93,6 +96,9 @@ ...@@ -93,6 +96,9 @@
</if> </if>
jump_url = #{jumpUrl}, jump_url = #{jumpUrl},
url_number = #{urlNumber}, url_number = #{urlNumber},
business_card_id = #{businessCardId},
business_card_type = #{businessCardType},
business_card_isOpen = #{businessCardIsOpen},
update_time=NOW() update_time=NOW()
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
...@@ -184,6 +190,12 @@ ...@@ -184,6 +190,12 @@
ORDER BY n.create_time DESC ORDER BY n.create_time DESC
</select> </select>
<select id="getCountByBusinessCardId" parameterType="long" resultType="long">
select count(1)
from applet_news
where business_card_id=#{businessCardId}
</select>
<select id="getByNewsClassifyId" parameterType="long" resultMap="BaseResultMap"> <select id="getByNewsClassifyId" parameterType="long" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> select <include refid="Base_Column_List"/>
......
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