|
|
@@ -1023,8 +1023,92 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
+ <select id="findAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
|
|
|
+
|
|
|
+ select
|
|
|
+ a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
|
|
|
+ a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
|
|
|
+ a.owner_name as ownerName, a.owner_type as ownerType, a.owner_mobile as ownerMobile,a.field_a as fieldA,a.field_b ,a.field_c as fieldC,
|
|
|
+ a.status, a.release_date as releaseDate, a.audit_status as auditStatus,f.name as field,f2.name as fieldB,ifnull(b.countInterest,0) as countInterest
|
|
|
+ from achievement a
|
|
|
+ left join (
|
|
|
+ select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
|
|
|
+ )b on a.id = b.achievement_id
|
|
|
+ left join field_glossory f on a.field_a=f.id
|
|
|
+ left join field_glossory f2 on a.field_b=f2.id
|
|
|
+ where deleted_sign = 0
|
|
|
+ <if test="ownerId != null">
|
|
|
+ and a.owner_id = #{ownerId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="serialNumber != null">
|
|
|
+ and a.serial_number = #{serialNumber,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="auditStatus != null">
|
|
|
+ and a.audit_status = #{auditStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+
|
|
|
+ and a.name = #{name,jdbcType=VARCHAR}
|
|
|
+
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null">
|
|
|
+
|
|
|
+ and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
|
|
|
+
|
|
|
+ </if>
|
|
|
+ <if test="dataCategory != null and dataCategory != ''">
|
|
|
+ and a.data_category = #{dataCategory,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="category != null">
|
|
|
+ and a.category = #{category,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="ownerType != null">
|
|
|
+ and a.owner_type = #{ownerType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="fieldA != null">
|
|
|
+ and a.field_a = #{fieldA,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and a.status = #{status,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="rStart != null">
|
|
|
+ and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="rEnd != null">
|
|
|
+ and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="releaseStatus != null">
|
|
|
+ and a.release_status = #{releaseStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ order by serial_number desc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
|
|
|
+ <select id="findAchievementCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(1)
|
|
|
+ from achievement a
|
|
|
+ left join field_glossory f on a.field_a=f.id
|
|
|
+ left join field_glossory f2 on a.field_b=f2.id
|
|
|
+ where deleted_sign = 0
|
|
|
+ <if test="ownerId != null">
|
|
|
+ and a.owner_id = #{ownerId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="serialNumber != null">
|
|
|
+ and a.serial_number = #{serialNumber,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="auditStatus != null">
|
|
|
+ and a.audit_status = #{auditStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+
|
|
|
+ and a.name = #{name,jdbcType=VARCHAR}
|
|
|
+
|
|
|
+ </if>
|
|
|
+ <select id="findAppAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
|
|
|
|
|
|
select
|
|
|
a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
|
|
|
@@ -1089,13 +1173,14 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
- <select id="findAchievementCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
+ <select id="findAppAchievementCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
select
|
|
|
count(1)
|
|
|
from achievement a
|
|
|
left join field_glossory f on a.field_a=f.id
|
|
|
left join field_glossory f2 on a.field_b=f2.id
|
|
|
where deleted_sign = 0
|
|
|
+ and audit_status = 3
|
|
|
<if test="ownerId != null">
|
|
|
and a.owner_id = #{ownerId,jdbcType=VARCHAR}
|
|
|
</if>
|