Merge remote-tracking branch 'origin/new-exam' into new-exam

pg_adapter
dshclm 8 months ago
commit 7e7629f16f

@ -1,9 +1,16 @@
package com.ruoyi.web.controller.manager; package com.ruoyi.web.controller.manager;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.text.CharSequenceUtil;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.place.TdPlaceRegist;
import com.ruoyi.system.service.place.TdPlaceRegistService; import com.ruoyi.system.service.place.TdPlaceRegistService;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/** /**
* packageName com.ruoyi.web.controller.manager * packageName com.ruoyi.web.controller.manager
@ -20,4 +27,32 @@ public class TdPlaceRegistManager {
@Resource @Resource
private TdPlaceRegistService placeRegistService; private TdPlaceRegistService placeRegistService;
public List<TdPlaceRegist> selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist) {
return placeRegistService.selectTdPlaceRegistList(tdPlaceRegist);
}
public boolean saveOrUpdate(TdPlaceRegist tdPlaceRegist) {
if (CharSequenceUtil.isNotBlank(tdPlaceRegist.getId())) {
tdPlaceRegist.setUpdateBy(ShiroUtils.getSysUser().getLoginName());
tdPlaceRegist.setUpdateTime(new Date());
} else {
tdPlaceRegist.setCreateBy(ShiroUtils.getSysUser().getLoginName());
tdPlaceRegist.setCreateTime(new Date());
}
return placeRegistService.saveOrUpdate(tdPlaceRegist);
}
public TdPlaceRegist selectTdPlaceRegist(String id) {
return placeRegistService.getById(id);
}
public boolean deleteTdPlaceRegistByids(String ids) {
List<String> list = Arrays.asList(Convert.toStrArray(ids));
return placeRegistService.removeByIds(list);
}
} }

@ -1,11 +1,19 @@
package com.ruoyi.web.controller.place; package com.ruoyi.web.controller.place;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.place.TdPlaceRegist;
import com.ruoyi.web.controller.manager.TdPlaceRegistManager; import com.ruoyi.web.controller.manager.TdPlaceRegistManager;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* packageName com.ruoyi.web.controller.place * packageName com.ruoyi.web.controller.place
@ -21,8 +29,95 @@ import javax.annotation.Resource;
public class TdPlaceRegistController extends BaseController { public class TdPlaceRegistController extends BaseController {
private String prefix = "system/placeRegist";
@Resource @Resource
private TdPlaceRegistManager placeRegistManager; private TdPlaceRegistManager placeRegistManager;
@RequiresPermissions("system:placeRegist:view")
@GetMapping()
public String placeRegist() {
return prefix + "/placeRegist";
}
/**
*
*/
@RequiresPermissions("system:placeRegist:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TdPlaceRegist tdPlaceRegist) {
startPage();
List<TdPlaceRegist> tdPlaceRegists = placeRegistManager.selectTdPlaceRegistList(tdPlaceRegist);
return getDataTable(tdPlaceRegists);
}
/**
*
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("system:placeRegist:add")
@Log(title = "场所出入登记", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TdPlaceRegist tdPlaceRegist) {
return toAjax(placeRegistManager.saveOrUpdate(tdPlaceRegist));
}
/**
*
*/
@RequiresPermissions("system:placeRegist:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap) {
TdPlaceRegist tdPlaceRegist = placeRegistManager.selectTdPlaceRegist(id);
mmap.put("tdPlaceRegist", tdPlaceRegist);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("system:placeRegist:edit")
@Log(title = "场所出入登记", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TdPlaceRegist tdPlaceRegist) {
return toAjax(placeRegistManager.saveOrUpdate(tdPlaceRegist));
}
/**
*
*/
@RequiresPermissions("system:placeRegist:detail")
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") String id, ModelMap mmap) {
TdPlaceRegist tdPlaceRegist = placeRegistManager.selectTdPlaceRegist(id);
mmap.put("tdPlaceRegist", tdPlaceRegist);
return prefix + "/detail";
}
/**
*
*/
@RequiresPermissions("system:placeRegist:remove")
@Log(title = "场所出入登记", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(placeRegistManager.deleteTdPlaceRegistByids(ids));
}
} }

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.place.TdPlaceRegist; import com.ruoyi.system.domain.place.TdPlaceRegist;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* @author 13560 * @author 13560
* @description td_place_regist()Mapper * @description td_place_regist()Mapper
@ -13,6 +15,9 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface TdPlaceRegistMapper extends BaseMapper<TdPlaceRegist> { public interface TdPlaceRegistMapper extends BaseMapper<TdPlaceRegist> {
public List<TdPlaceRegist> selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist);
} }

@ -1,8 +1,11 @@
package com.ruoyi.system.service.place; package com.ruoyi.system.service.place;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.place.TdPlace;
import com.ruoyi.system.domain.place.TdPlaceRegist; import com.ruoyi.system.domain.place.TdPlaceRegist;
import java.util.List;
/** /**
* @author 13560 * @author 13560
* @description td_place_regist()Service * @description td_place_regist()Service
@ -10,4 +13,7 @@ import com.ruoyi.system.domain.place.TdPlaceRegist;
*/ */
public interface TdPlaceRegistService extends IService<TdPlaceRegist> { public interface TdPlaceRegistService extends IService<TdPlaceRegist> {
public List<TdPlaceRegist> selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist);
} }

@ -2,10 +2,14 @@ package com.ruoyi.system.service.place.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.place.TdPlaceRegist; import com.ruoyi.system.domain.place.TdPlaceRegist;
import com.ruoyi.system.mapper.place.TdPlaceMapper;
import com.ruoyi.system.mapper.place.TdPlaceRegistMapper; import com.ruoyi.system.mapper.place.TdPlaceRegistMapper;
import com.ruoyi.system.service.place.TdPlaceRegistService; import com.ruoyi.system.service.place.TdPlaceRegistService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* @author 13560 * @author 13560
* @description td_place_regist()Service * @description td_place_regist()Service
@ -15,6 +19,14 @@ import org.springframework.stereotype.Service;
public class TdPlaceRegistServiceImpl extends ServiceImpl<TdPlaceRegistMapper, TdPlaceRegist> public class TdPlaceRegistServiceImpl extends ServiceImpl<TdPlaceRegistMapper, TdPlaceRegist>
implements TdPlaceRegistService { implements TdPlaceRegistService {
@Resource
private TdPlaceRegistMapper tdPlaceRegistMapper;
@Override
public List<TdPlaceRegist> selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist) {
return tdPlaceRegistMapper.selectTdPlaceRegistList(tdPlaceRegist);
}
} }

@ -29,4 +29,20 @@
dept_id,create_by,create_time, dept_id,create_by,create_time,
update_by,update_time,remark update_by,update_time,remark
</sql> </sql>
<select id="selectTdPlaceRegistList" resultType="com.ruoyi.system.domain.place.TdPlaceRegist">
select <include refid="Base_Column_List"/> from td_place_regist
<trim prefix="where" prefixOverrides="and|or">
<if test="placeName!=null and placeName!=''">
AND place_name LIKE concat('%',#{placeName},'%')
</if>
<if test="registName!=null and registName!=''">
AND regist_name LIKE concat('%',#{registName},'%')
</if>
<if test="registTime!=null">
AND regist_time = #{registTime}
</if>
</trim>
ORDER BY create_time DESC
</select>
</mapper> </mapper>

Loading…
Cancel
Save