Explorar o código

作业那天展示记录
调度员查看在馆书籍增加录入时间

shenhao %!s(int64=5) %!d(string=hai) anos
pai
achega
e5a3953c53

+ 6 - 1
src/main/java/com/ssj/dao/weixin/library/dao/impl/OneQueryDaoImpl.java

@@ -523,7 +523,7 @@ public class OneQueryDaoImpl implements IOneBookQueryDao {
 		StringBuilder selSql = new StringBuilder();
 		List<Object> queryParams = new ArrayList<Object>();
 		selSql.append("SELECT t11.league_name ,t12.title ,t13.`name` as fname,t14.`name` as sname,t12.price,t15.bookcase  \n");
-		selSql.append(",t12.isbn13 \n");
+		selSql.append(",t12.isbn13,t15.create_time \n");
 		selSql.append("from tb_lib_join t11 \n");
 		selSql.append("join tb_lib_book_info t12 on t12.lib_id = t11.id \n");
 		selSql.append("join tb_lib_book_detail t15 on t12.id = t15.info_id \n");
@@ -536,6 +536,11 @@ public class OneQueryDaoImpl implements IOneBookQueryDao {
 		}else{
 			selSql.append(" and t11.league_name='' \n");
 		}
+		if(params.get("queryDate")!=null && !"".equals(params.get("queryDate").toString())){
+			selSql.append("and   to_days(t15.create_time)=to_days(?)  \n");
+			queryParams.add(params.get("queryDate"));
+		}
+		selSql.append(" order by t15.create_time desc \n");
 		return dao.findPage(selSql.toString(),queryParams.toArray(), initPage);
 	}
 

+ 3 - 1
src/main/java/com/ssj/sys/controller/DispatcherController.java

@@ -212,7 +212,8 @@ public class DispatcherController extends BaseController {
                            @RequestParam(required = false, defaultValue = "1") int pageNo) throws Exception{
 
         Map<String, Object> params = new HashMap<String, Object>();
-        params.put("leagueName",request.getParameter("leagueName")==null?"":request.getParameter("leagueName"));//图书馆
+        params.put("leagueName",request.getParameter("leagueName")==null?"":request.getParameter("leagueName"));
+        params.put("queryDate",request.getParameter("queryDate")==null?"":request.getParameter("queryDate"));
         SplitPage sp = new SplitPage();
         sp.setAction(request.getRequestURI().toString());
         sp.setPageNo(pageNo);
@@ -256,6 +257,7 @@ public class DispatcherController extends BaseController {
             entity.add(new ExcelExportEntity("价钱", "price"));
             entity.add(new ExcelExportEntity("书架位置", "bookcase"));
             entity.add(new ExcelExportEntity("ISBN", "isbn13"));
+            entity.add(new ExcelExportEntity("录入时间", "create_time"));
 
             //把我们构造好的bean对象放到params就可以了
             Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("图书馆图书记录数据", "图书馆图书记录数据", ExcelType.XSSF), entity,

+ 61 - 21
src/main/resources/mybatis/mapper/CuratorMapper.xml

@@ -364,27 +364,67 @@
     </select>
 
     <select id="homeworkIndex" resultType="java.util.Map">
-            select t11.vip_id,t.id,t12.child_name,t12.grade,t13.league_name,t12.school,count(1) as pictureCount,group_concat(t11.file_key) as file_keys,t11.create_time,t.`subject`
-                   ,count(IF(t11.corrected_picture_url is not null,true,null)) as correctedCount,group_concat(t11.corrected_picture_url) as corrected_keys
-                   ,count(IF(t.subject='语文',true,null)) as count1,count(IF(t.subject='数学',true,null)) as count2,count(IF(t.subject='英语',true,null)) as count3
-                     from scon_homework t
-                left join scon_homework_picture t11 on t.id = t11.homework_id
-                left join tb_lib_vip t12 on t11.vip_id = t12.id
-                left join tb_lib_join t13 on t12.lib_id = t13.id
-                where
-                    t12.lib_id=#{libId} and t11.is_delete = 0
-                <if test="queryDate !=null and queryDate!=''">
-                    and t11.create_time >= #{queryDate}
-                </if>
-               <if test="queryEndDate !=null and queryEndDate!=''">
-                    and  #{queryEndDate} >=t11.create_time
-                </if>
-
-                <if test="searchValue != '' ">
-                    and t12.child_name regexp #{searchValue}
-                </if>
-                group  by t11.vip_id
-                order by t.subject,t11.create_time desc
+        SELECT
+        a.vip_id,
+        a.id,
+        a.child_name,
+        a.grade,
+        a.league_name,
+        a.school,
+        count( 1 ) AS pictureCount,
+        group_concat( a.file_key ) AS file_keys,
+        a.create_time,
+        a.`subject`,
+        count(
+        IF
+        ( a.corrected_picture_url IS NOT NULL, TRUE, NULL )) AS correctedCount,
+        group_concat( a.corrected_picture_url ) AS corrected_keys,
+        count(
+        IF
+        ( a.SUBJECT = '语文', TRUE, NULL )) AS count1,
+        count(
+        IF
+        ( a.SUBJECT = '数学', TRUE, NULL )) AS count2,
+        count(
+        IF
+        ( a.SUBJECT = '英语', TRUE, NULL )) AS count3
+        FROM
+        (
+        SELECT
+        t11.vip_id,
+        t.id,
+        t12.child_name,
+        t12.grade,
+        t13.league_name,
+        t12.school,
+        t11.file_key,
+        DATE_FORMAT( t11.create_time, '%Y-%m-%d' ) AS create_time,
+        t.`subject`,
+        t11.corrected_picture_url
+        FROM
+        scon_homework t
+        LEFT JOIN scon_homework_picture t11 ON t.id = t11.homework_id
+        LEFT JOIN tb_lib_vip t12 ON t11.vip_id = t12.id
+        LEFT JOIN tb_lib_join t13 ON t12.lib_id = t13.id
+        WHERE
+        t12.lib_id = #{libId}
+        AND t11.is_delete = 0
+        <if test="queryDate !=null and queryDate!=''">
+        AND to_days(t11.create_time) >= TO_DAYS(#{queryDate})
+        </if>
+        <if test="queryEndDate !=null and queryEndDate!=''">
+        AND to_days(  #{queryEndDate} ) >= to_days( t11.create_time )
+        </if>
+        <if test="searchValue != '' ">
+            and t12.child_name regexp #{searchValue}
+        </if>
+        ) a
+        GROUP BY
+        a.create_time,
+        a.vip_id
+        ORDER BY
+        a.SUBJECT,
+        a.create_time DESC
     </select>
 
     <select id="findPageStudentList" resultType="java.util.Map">

+ 6 - 0
src/main/resources/templates/sys/dispatcher/libInfolist.html

@@ -34,6 +34,10 @@
 					<input type="text" id="leagueName" name="leagueName" th:value="${search.get('leagueName')}" class="scinput date_width " placeholder="图书馆">
 				</li>
 				<li>
+					<label>录入日期:</label>
+					<input type="text" id="queryDate" name="queryDate" autocomplete="off"   onclick=" WdatePicker({ dateFmt: 'yyyy-MM-dd', isShowToday: false, isShowClear: false });" th:value="${search.queryDate }" class="scinput date_width " placeholder="录入日期">
+				</li>
+				<li>
 					<input type="button" class="scbtn" value="查询" />
 					<input type="button" id="button" class="scbtn" value="导出" />
 				</li>
@@ -53,6 +57,7 @@
 				<th>价格</th>
 				<th>书架位置</th>
 				<th>ISBN</th>
+				<th>录入时间</th>
 		    </tr>
 		</thead>
 		<tbody>
@@ -66,6 +71,7 @@
 				<td th:text="${item.get('price')}"></td>
 				<td th:text="${item.get('bookcase')}"></td>
 				<td th:text="${item.get('isbn13')}"></td>
+				<td th:text="${item.get('create_time')}"></td>
 			</tr>
 		</tbody>
 	</table>

+ 5 - 3
src/main/resources/templates/sys/fx/curator/homeworkIndex.html

@@ -68,6 +68,7 @@
 		        <th>年级</th>
 				<th>学校</th>
 		        <th>绑定校区</th>
+		        <th>作业日期</th>
 		        <th>上传作业份数</th>
 				<th>语文作业份数</th>
 				<th>数学作业份数</th>
@@ -83,19 +84,20 @@
 					<td th:text="${item.get('grade')}" ></td>
 					<td th:text="${item.get('school')}" ></td>
 					<td th:text="${item.get('league_name')}" ></td>
+					<td th:text="${item.get('create_time')}" ></td>
 					<td><a class="tablelink" href="javascript:;" th:onclick="'updateById(\''+${item.get('file_keys')}+'\')'">[[${item.get('pictureCount')}]]</a></td>
 					<td>
-						<a th:href="@{/sys/admin/curator/homeworkInfoVip.html(vipId=${item.get('vip_id')},subject='语文',queryDate=${search.get('queryDate')},libId=${search.get('libId')},childName=${item.get('child_name')})}">
+						<a th:href="@{/sys/admin/curator/homeworkInfoVip.html(vipId=${item.get('vip_id')},subject='语文',queryDate=${item.get('create_time')},libId=${search.get('libId')},childName=${item.get('child_name')})}">
 							[[${item.get('count1')}]]
 						</a>
 					</td>
 					<td>
-						<a th:href="@{/sys/admin/curator/homeworkInfoVip.html(vipId=${item.get('vip_id')},subject='数学',queryDate=${search.get('queryDate')},libId=${search.get('libId')},childName=${item.get('child_name')})}">
+						<a th:href="@{/sys/admin/curator/homeworkInfoVip.html(vipId=${item.get('vip_id')},subject='数学',queryDate=${item.get('create_time')},libId=${search.get('libId')},childName=${item.get('child_name')})}">
 							[[${item.get('count2')}]]
 						</a>
 					</td>
 					<td>
-						<a th:href="@{/sys/admin/curator/homeworkInfoVip.html(vipId=${item.get('vip_id')},subject='英语',queryDate=${search.get('queryDate')},libId=${search.get('libId')},childName=${item.get('child_name')})}">
+						<a th:href="@{/sys/admin/curator/homeworkInfoVip.html(vipId=${item.get('vip_id')},subject='英语',queryDate=${item.get('create_time')},libId=${search.get('libId')},childName=${item.get('child_name')})}">
 							[[${item.get('count3')}]]
 						</a>
 					</td>