20200529-zlp-2
1新增视频学习列表页(标题兼容性) 2删除讲师为软删除
This commit is contained in:
@ -25,14 +25,13 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 讲师Controller
|
||||
*
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/benyi/lecturer")
|
||||
public class ByLecturerController extends BaseController
|
||||
{
|
||||
public class ByLecturerController extends BaseController {
|
||||
@Autowired
|
||||
private IByLecturerService byLecturerService;
|
||||
|
||||
@ -41,8 +40,7 @@ public class ByLecturerController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ByLecturer byLecturer)
|
||||
{
|
||||
public TableDataInfo list(ByLecturer byLecturer) {
|
||||
startPage();
|
||||
List<ByLecturer> list = byLecturerService.selectByLecturerList(byLecturer);
|
||||
return getDataTable(list);
|
||||
@ -66,8 +64,7 @@ public class ByLecturerController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:export')")
|
||||
@Log(title = "讲师", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ByLecturer byLecturer)
|
||||
{
|
||||
public AjaxResult export(ByLecturer byLecturer) {
|
||||
List<ByLecturer> list = byLecturerService.selectByLecturerList(byLecturer);
|
||||
ExcelUtil<ByLecturer> util = new ExcelUtil<ByLecturer>(ByLecturer.class);
|
||||
return util.exportExcel(list, "lecturer");
|
||||
@ -78,8 +75,7 @@ public class ByLecturerController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(byLecturerService.selectByLecturerById(id));
|
||||
}
|
||||
|
||||
@ -89,10 +85,10 @@ public class ByLecturerController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:add')")
|
||||
@Log(title = "讲师", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ByLecturer byLecturer)
|
||||
{
|
||||
public AjaxResult add(@RequestBody ByLecturer byLecturer) {
|
||||
byLecturer.setCreatetime(new Date());
|
||||
byLecturer.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||
byLecturer.setIsdel("0");
|
||||
return toAjax(byLecturerService.insertByLecturer(byLecturer));
|
||||
}
|
||||
|
||||
@ -102,8 +98,7 @@ public class ByLecturerController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:edit')")
|
||||
@Log(title = "讲师", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ByLecturer byLecturer)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody ByLecturer byLecturer) {
|
||||
return toAjax(byLecturerService.updateByLecturer(byLecturer));
|
||||
}
|
||||
|
||||
@ -112,9 +107,8 @@ public class ByLecturerController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:remove')")
|
||||
@Log(title = "讲师", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(byLecturerService.deleteByLecturerByIds(ids));
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,10 @@ public class ByLecturer extends BaseEntity
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createtime;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
private String isdel;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -96,6 +100,15 @@ public class ByLecturer extends BaseEntity
|
||||
public Date getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
public void setIsdel(String isdel)
|
||||
{
|
||||
this.isdel = isdel;
|
||||
}
|
||||
|
||||
public String getIsdel()
|
||||
{
|
||||
return isdel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -106,6 +119,7 @@ public class ByLecturer extends BaseEntity
|
||||
.append("imgurl", getImgurl())
|
||||
.append("createuserid", getCreateuserid())
|
||||
.append("createtime", getCreatetime())
|
||||
.append("isdel", getIsdel())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="name" column="name" />
|
||||
<result property="information" column="information" />
|
||||
<result property="imgurl" column="imgurl" />
|
||||
<result property="isdel" column="isdel" />
|
||||
<result property="createuserid" column="createuserid" />
|
||||
<result property="createtime" column="createtime" />
|
||||
</resultMap>
|
||||
@ -19,13 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectByLecturerList" parameterType="ByLecturer" resultMap="ByLecturerResult">
|
||||
<include refid="selectByLecturerVo"/>
|
||||
<where>
|
||||
where isdel='0'
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="information != null and information != ''"> and information = #{information}</if>
|
||||
<if test="imgurl != null and imgurl != ''"> and imgurl = #{imgurl}</if>
|
||||
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
|
||||
<if test="createtime != null "> and createtime = #{createtime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByLecturerById" parameterType="Long" resultMap="ByLecturerResult">
|
||||
@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="imgurl != null and imgurl != ''">imgurl,</if>
|
||||
<if test="createuserid != null ">createuserid,</if>
|
||||
<if test="createtime != null ">createtime,</if>
|
||||
<if test="isdel != null and isdel != ''">isdel,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">#{id},</if>
|
||||
@ -50,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="imgurl != null and imgurl != ''">#{imgurl},</if>
|
||||
<if test="createuserid != null ">#{createuserid},</if>
|
||||
<if test="createtime != null ">#{createtime},</if>
|
||||
<if test="isdel != null and isdel != ''">#{isdel},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -66,11 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteByLecturerById" parameterType="Long">
|
||||
delete from by_lecturer where id = #{id}
|
||||
update by_lecturer set isdel='1' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByLecturerByIds" parameterType="String">
|
||||
delete from by_lecturer where id in
|
||||
update by_lecturer set isdel='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
Reference in New Issue
Block a user