fix
Helius
2022-12-14 62a304eb5c68fc7f54a9bc247e76223cc2c7f243
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?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="com.xcong.farmer.cms.modules.system.mapper.CmsTemplateMapper">
 
    <select id="selectInPage" resultType="com.xcong.farmer.cms.modules.system.entity.CmsTemplateEntity">
        select * from cms_template
        <where>
            1=1
            <if test="record.companyId != null and record.companyId != 0">
                and company_id=#{record.companyId}
            </if>
        </where>
    </select>
 
    <delete id="delete">
        delete from cms_template
        where id=#{id}
          <if test="companyId != null and companyId != 0">
              and company_id=#{companyId}
          </if>
    </delete>
 
    <select id="selectByIdAndCompanyId" resultType="com.xcong.farmer.cms.modules.system.entity.CmsTemplateEntity">
        select * from cms_template
            where id = #{id}
            <if test="companyId != null and companyId != 0">
                and company_id = #{companyId}
            </if>
    </select>
</mapper>