长庆项目day3

This commit is contained in:
ovo 2024-10-19 18:58:39 +08:00
parent f81eef47b7
commit b3bfb9bc4b
3 changed files with 11 additions and 5 deletions

View File

@ -57,11 +57,13 @@ public class CqEnterController {
}
@GetMapping("/rulesByType")
public R rulesByType(Integer typeId){
public R rulesByType(Integer typeId, Long cellId){
if(typeId == null){
typeId = cqMemberMapper.speciallyForVisitors();
}
List<TypeRules> typeRules = cqEnterMapper.rulesByType(typeId);
List<TypeRules> typeRules = cqEnterMapper.rulesByType(typeId, cellId);
return R.ok().put("data", typeRules);
}

View File

@ -18,7 +18,7 @@ public interface CqEnterMapper extends BaseMapper<TenEnterConfigEntity> {
List<PeronType> getPersonType();
List<TypeRules> rulesByType(int typeId);
List<TypeRules> rulesByType(int typeId, @Param("cellId") Long cellId);
int changeState(int ruleId);
}

View File

@ -23,7 +23,7 @@
cell_id ;
</select>
<select id="getPersonType" resultType="net.shapelight.modules.iCq.controller.enter.vo.PeronType">
select label_id, name FROM ten_label WHERE delete_flag = 0
select type, name FROM ten_label WHERE delete_flag = 0
</select>
<select id="rulesByType" resultType="net.shapelight.modules.iCq.controller.enter.vo.TypeRules">
SELECT
@ -36,6 +36,10 @@
ON
tec.id = tect.enter_config_id
WHERE
tect.type_id = #{typeId};
tect.type_id = #{typeId}
<if test="cellId != null and cellId != ''">
and cell_id = #{cell_id};
</if>
</select>
</mapper>