Commit f11da444 by zhiwj

添加接口

parent f90660e2
......@@ -48,6 +48,10 @@ public class ProblemDTO implements Serializable {
private String memberPhone;
/**
* 会员头像
*/
private String memberImgUrl;
/**
* 评论内容
*/
private String problemContent;
......@@ -270,4 +274,12 @@ public class ProblemDTO implements Serializable {
public String getReplyUserContent() {
return replyUserContent;
}
public String getMemberImgUrl() {
return memberImgUrl;
}
public void setMemberImgUrl(String memberImgUrl) {
this.memberImgUrl = memberImgUrl;
}
}
\ No newline at end of file
......@@ -42,6 +42,11 @@ public class TabProblem {
private String memberPhone;
/**
* 会员头像
*/
private String memberImgUrl;
/**
* 评论内容
*/
private String problemContent;
......@@ -142,6 +147,14 @@ public class TabProblem {
this.memberPhone = memberPhone;
}
public String getMemberImgUrl() {
return memberImgUrl;
}
public void setMemberImgUrl(String memberImgUrl) {
this.memberImgUrl = memberImgUrl;
}
public String getProblemContent() {
return problemContent;
}
......
......@@ -57,7 +57,7 @@ public class ProblemManageApiServiceImpl implements ProblemManageApiService {
public ServiceResponse<ProblemDTO> getProblem(Integer problemId) {
TabProblem tabProblem = problemService.getProblem(problemId);
if (tabProblem == null) {
return EnterpriseServiceResponse.failure(ErrorCode.DATA_EXISTS);
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
ProblemDTO problemDTO = EntityUtil.changeEntityByJSON(ProblemDTO.class, tabProblem);
if (Constants.OPEN.equals(problemDTO.getHasOtherImage())) {
......
......@@ -62,6 +62,7 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService {
MemberUserDTO memberUserDTO = memberUserDTOServiceResponse.getResult();
problemDTO.setMemberName(memberUserDTO.getName());
problemDTO.setMemberPhone(memberUserDTO.getMobile());
// problemDTO.setMemberImgUrl(memberUserDTO);
}
Integer problemId = problemService.save(problemDTO);
if (CollectionUtils.isNotEmpty(imgList)) {
......
......@@ -9,6 +9,7 @@
<result column="member_id" jdbcType="BIGINT" property="memberId" />
<result column="member_name" jdbcType="VARCHAR" property="memberName" />
<result column="member_phone" jdbcType="VARCHAR" property="memberPhone" />
<result column="member_img_url" jdbcType="VARCHAR" property="memberImgUrl" />
<result column="problem_content" jdbcType="VARCHAR" property="problemContent" />
<result column="image_url" jdbcType="VARCHAR" property="imageUrl" />
<result column="has_other_image" jdbcType="INTEGER" property="hasOtherImage" />
......@@ -21,8 +22,8 @@
</resultMap>
<sql id="Base_Column_List">
problem_id, enterprise_id, store_id, store_name, member_id, member_name, member_phone,
problem_content, image_url, has_other_image, problem_status, malicious_status, show_status,
status, create_time, update_time
member_img_url, problem_content, image_url, has_other_image, problem_status, malicious_status,
show_status, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -37,21 +38,21 @@
<insert id="insert" parameterType="com.gic.evaluate.entity.TabProblem">
insert into tab_problem (problem_id, enterprise_id, store_id,
store_name, member_id, member_name,
member_phone, problem_content, image_url,
has_other_image, problem_status, malicious_status,
show_status, status, create_time,
update_time)
member_phone, member_img_url, problem_content,
image_url, has_other_image, problem_status,
malicious_status, show_status, status,
create_time, update_time)
values (#{problemId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{storeId,jdbcType=INTEGER},
#{storeName,jdbcType=VARCHAR}, #{memberId,jdbcType=BIGINT}, #{memberName,jdbcType=VARCHAR},
#{memberPhone,jdbcType=VARCHAR}, #{problemContent,jdbcType=VARCHAR}, #{imageUrl,jdbcType=VARCHAR},
#{hasOtherImage,jdbcType=INTEGER}, #{problemStatus,jdbcType=INTEGER}, #{maliciousStatus,jdbcType=INTEGER},
#{showStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{memberPhone,jdbcType=VARCHAR}, #{memberImgUrl,jdbcType=VARCHAR}, #{problemContent,jdbcType=VARCHAR},
#{imageUrl,jdbcType=VARCHAR}, #{hasOtherImage,jdbcType=INTEGER}, #{problemStatus,jdbcType=INTEGER},
#{maliciousStatus,jdbcType=INTEGER}, #{showStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.evaluate.entity.TabProblem">
<selectKey keyProperty="problemId" order="AFTER" resultType="java.lang.Integer">
<selectKey keyProperty="problemId" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
</selectKey>
insert into tab_problem
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="problemId != null">
......@@ -75,6 +76,9 @@
<if test="memberPhone != null">
member_phone,
</if>
<if test="memberImgUrl != null">
member_img_url,
</if>
<if test="problemContent != null">
problem_content,
</if>
......@@ -125,6 +129,9 @@
<if test="memberPhone != null">
#{memberPhone,jdbcType=VARCHAR},
</if>
<if test="memberImgUrl != null">
#{memberImgUrl,jdbcType=VARCHAR},
</if>
<if test="problemContent != null">
#{problemContent,jdbcType=VARCHAR},
</if>
......@@ -175,6 +182,9 @@
<if test="memberPhone != null">
member_phone = #{memberPhone,jdbcType=VARCHAR},
</if>
<if test="memberImgUrl != null">
member_img_url = #{memberImgUrl,jdbcType=VARCHAR},
</if>
<if test="problemContent != null">
problem_content = #{problemContent,jdbcType=VARCHAR},
</if>
......@@ -213,6 +223,7 @@
member_id = #{memberId,jdbcType=BIGINT},
member_name = #{memberName,jdbcType=VARCHAR},
member_phone = #{memberPhone,jdbcType=VARCHAR},
member_img_url = #{memberImgUrl,jdbcType=VARCHAR},
problem_content = #{problemContent,jdbcType=VARCHAR},
image_url = #{imageUrl,jdbcType=VARCHAR},
has_other_image = #{hasOtherImage,jdbcType=INTEGER},
......@@ -224,20 +235,21 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where problem_id = #{problemId,jdbcType=INTEGER}
</update>
<select id="listProblem" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_problem
<where>
<if test="null != problemIds and problemIds.size > 0">
<if test="null != problemIds and problemIds.size &gt; 0">
and problem_id in
<foreach collection="problemIds" index="index" item="item" open="(" separator="," close=")">
<foreach close=")" collection="problemIds" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
<if test="null != storeIdList and storeIdList.size > 0">
<if test="null != storeIdList and storeIdList.size &gt; 0">
and store_id in
<foreach collection="storeIdList" index="index" item="item" open="(" separator="," close=")">
<foreach close=")" collection="storeIdList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
......@@ -267,15 +279,15 @@
count(*)
from tab_problem
<where>
<if test="null != storeIdList and storeIdList.size > 0">
<if test="null != storeIdList and storeIdList.size &gt; 0">
and store_id in
<foreach collection="storeIdList" index="index" item="item" open="(" separator="," close=")">
<foreach close=")" collection="storeIdList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
<if test="null != problemIds and problemIds.size > 0">
<if test="null != problemIds and problemIds.size &gt; 0">
and problem_id in
<foreach collection="problemIds" index="index" item="item" open="(" separator="," close=")">
<foreach close=")" collection="problemIds" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
......
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