| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?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="platform.modules.government.dao.AttachmentDao">
- <select id="selectByIdAndBusinessId" resultType="platform.modules.government.entity.Attachment">
- select * from attachment where del_flag=0
- <if test="id!=null and id!=''">
- and id=#{id}
- </if>
- and business_type=#{business_type} and business_id=#{business_id}
- </select>
- <update id="updateAttachment">
- update attachment set business_type=#{business_type},business_id=#{business_id},del_flag=0
- where id=#{id}
- </update>
- <update id="deleteByBusiness">
- update attachment set del_flag=1
- where business_type=#{business_type} and business_id=#{business_id}
- </update>
-
- <update id="deleteByIdAndBusinessId">
- update attachment set del_flag=1
- where business_type=#{business_type} and business_id=#{business_id}
- <if test="id!=null and id!=''">
- and id=#{id}
- </if>
- </update>
- <select id="findListBySupport" resultType="platform.modules.government.entity.Attachment">
- select a.* from attachment a
- LEFT JOIN ic_park_support_attachment psa ON psa.id = a.business_id
- WHERE
- psa.del_flag = 0
- AND a.business_type = #{attathmentType}
- AND psa.support_id = #{supportId}
- AND psa.type = #{type}
- </select>
- <select id="findListByTypicalCompany" resultType="platform.modules.government.entity.Attachment">
- select a.* from attachment a
- LEFT JOIN ic_park_typical_company_attachment iptca ON iptca.id = a.business_id
- WHERE
- iptca.del_flag = 0
- AND a.business_type = #{attachmentType}
- AND iptca.typical_company_id = #{typicalCompanyId}
- </select>
- <select id="findMainPicture" resultType="platform.modules.government.entity.Attachment">
- select a.* from attachment a
- LEFT JOIN ic_park_attachment pa on pa.attachment_id = a.id
- WHERE
- pa.park_id = #{id}
- AND pa.is_main = TRUE
- </select>
- <select id="findByBusinessType" resultType="platform.modules.government.entity.Attachment">
- select * from attachment where del_flag = 0 AND (business_type = #{streetType} or business_type = #{parkType})
- </select>
- <select id="findAnnex2" resultType="platform.modules.government.entity.Attachment">
- select * from attachment where del_flag = 0 AND business_type = #{annex_template_2}
- </select>
- </mapper>
|