<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.iocoder.yudao.module.knowledge.mapper.TViolationImageMapper" >


  <select id="selectByViolationId" resultType="cn.iocoder.yudao.module.knowledge.entity.TViolationImage">
    SELECT
    id AS id,
    filename AS filename,
    file_size AS fileSize,
    file_url AS fileUrl,
    sort AS sort,
    violation_code AS violationCode,
    dept_id AS deptId,
    identity_id AS identityId,
    create_time AS createTime,
    update_time AS updateTime,
    creator AS creator,
    violation_id AS violationId
    FROM t_violation_image
    WHERE
          violation_id = #{id}
      AND deleted = 0
    ORDER BY
      create_time DESC
  </select>

  <select id="findOneForApp" resultType="cn.iocoder.yudao.module.knowledge.entity.TViolationImage">
    SELECT
      id AS id,
      filename AS filename,
      file_size AS fileSize,
      file_url AS fileUrl,
      sort AS sort,
      violation_code AS violationCode,
      dept_id AS deptId,
      identity_id AS identityId,
      create_time AS createTime,
      update_time AS updateTime,
      creator AS creator,
      violation_id AS violationId
    FROM t_violation_image
    WHERE
      violation_id = #{id}
      AND deleted = 0
    ORDER BY
      create_time DESC
  </select>


</mapper>
