he2802 2 years ago
parent
commit
06336d9621

+ 22 - 21
run-prod.sh

@@ -1,33 +1,34 @@
 #!/usr/bin/env bash
 # 定义应用组名
-group_name='zhongzheng'
+group_admin_name='zhongzheng'
 # 定义应用名称
-app_name='zhongzheng-saas-api'
+app_admin_name='zhongzheng-saas-admin'
 # 定义应用版本
-app_version='1.0-SNAPSHOT'
+app_admin_version='1.0-SNAPSHOT'
 # 定义应用环境
 profile_active='prod'
-echo '----copy jar----'
-docker stop ${app_name}
-echo '----stop container----'
-docker rm ${app_name}
-echo '----rm container----'
-docker rmi ${group_name}/${app_name}:${app_version}
-echo '----rm image----'
+echo '----copy jar admin----'
+docker stop ${app_admin_name}
+echo '----stop container admin----'
+docker rm ${app_admin_name}
+echo '----rm container admin----'
+docker rmi ${group_admin_name}/${app_admin_name}:${app_admin_version}
+echo '----rm image admin----'
 # 打包编译docker镜像
-docker build -f /mydata/maven/build/Dockerfile -t ${group_name}/${app_name}:${app_version} .
-echo '----build image----'
-docker run -p 5055:5055 --name ${app_name} \
+docker build -f /mydata/maven/build/Dockerfile-admi -t ${group_admin_name}/${app_admin_name}:${app_admin_version} .
+echo '----build image admin----'
+docker run \
+-p 5030:5030 \
+--name ${app_admin_name} \
 --restart=always \
--e 'spring.profiles.active'=${profile_active} \
--e TZ="Asia/Shanghai" \
--m 10240m \
---cpus=3 \
 --log-opt max-size=50m \
 --log-opt max-file=3 \
+-e 'spring.profiles.active'=${profile_active} \
+-e TZ="Asia/Shanghai" \
 -v /etc/localtime:/etc/localtime \
 -v /usr/share/fonts:/usr/share/fonts \
--v /data/logs/prod_api:/logs \
--v /mydata/app/${app_name}/logs:/var/logs \
--d ${group_name}/${app_name}:${app_version}
-echo '----start container----'
+-v /data/logs/prod_admin:/logs \
+-v /mydata/app/${app_admin_name}/logs:/var/logs \
+-v /data/nginx/conf.d:/data/nginx/conf.d \
+-d ${group_admin_name}/${app_admin_name}:${app_admin_version}
+echo '----start container admin----'

+ 46 - 4
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

@@ -177,7 +177,7 @@
     </resultMap>
 
     <select id="selectListByBo" parameterType="com.zhongzheng.modules.bank.bo.QuestionQueryBo" resultMap="QuestionResultVo">
-       SELECT
+        SELECT
         q.*
         FROM
         question q
@@ -191,16 +191,58 @@
         </if>
 
         <if test="educationTypeId != null and educationTypeId != ''">
-            AND (select count(*) from question_business qb  where qb.type = 1 and qb.major_id = q.question_id and qb.education_type_id = #{educationTypeId}) >0
+            AND (select count(*) from question_business qb where qb.type = 1 and q.question_id = qb.major_id and  qb.education_type_id = #{educationTypeId}) >0
+        </if>
+        <if test="subjectId != null and subjectId != ''">
+            AND (select count(*) from question_business qb where qb.type = 1 and q.question_id = qb.major_id and  qb.subject_id = #{subjectId}) >0
+        </if>
+        <if test="type != null and type != ''">
+            AND q.type = #{type}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND (select count(*) from question_business qb where qb.type = 1 and q.question_id = qb.major_id and  qb.business_id = #{businessId}) >0
+        </if>
+        <if test="publishStatus != null ">
+            AND q.publish_status = #{publishStatus}
+        </if>
+        <if test="prefixName != null and prefixName != ''">
+            AND q.prefix_name like concat('%', #{prefixName}, '%')
+        </if>
+        <if test="key != null and key != ''">
+            AND (q.content like concat('%', #{key}, '%') or q.prefix_name like concat('%', #{key}, '%') or q.code like concat('%', #{key}, '%'))
+        </if>
+        <if test="pageSizeSelf != null and pageSizeSelf != ''">
+            LIMIT #{currIndex} , #{pageSizeSelf}
+        </if>
+        ORDER BY q.question_id DESC
+    </select>
+
+    <select id="selectListByBo_COUNT" resultType="Long">
+        SELECT
+        COUNT( DISTINCT q.question_id )
+        FROM
+        question q
+        LEFT JOIN question_business qb ON q.question_id = qb.major_id AND qb.type = 1
+        WHERE
+        1 = 1 AND q.status !=-1
+        <if test="status != null and status.size()!=0 ">
+            AND q.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND qb.education_type_id = #{educationTypeId}
         </if>
         <if test="subjectId != null and subjectId != ''">
-            AND (select count(*) from question_business qb  where qb.type = 1 and qb.major_id = q.question_id and qb.subject_id = #{subjectId}) >0
+            AND qb.subject_id = #{subjectId}
         </if>
         <if test="type != null and type != ''">
             AND q.type = #{type}
         </if>
         <if test="businessId != null and businessId != ''">
-            AND (select count(*) from question_business qb  where qb.type = 1 and qb.major_id = q.question_id and qb.business_id = #{businessId}) >0
+            AND qb.business_id = #{businessId}
         </if>
         <if test="publishStatus != null ">
             AND q.publish_status = #{publishStatus}