xiaoyong931011
2021-04-12 a13a93a493e7e94e28b2225c26e7e13b52d3288c
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopWxtemplateMsgDao.xml
@@ -16,6 +16,8 @@
         <result property="remark" column="remark" />
         <result property="companyId" column="company_id" />
         <result property="code" column="code" />
         <result property="tempType" column="temp_type" />
         <result property="templateClass" column="template_class" />
   </resultMap>
   
@@ -32,6 +34,8 @@
         <result property="remark" column="remark" />
         <result property="companyId" column="company_id" />
      <result property="code" column="code" />
      <result property="tempType" column="temp_type" />
      <result property="templateClass" column="template_class" />
   </resultMap>
   
   <!-- 字段sql -->
@@ -46,7 +50,9 @@
         status,
         remark,
         company_id,
         code
         code,
         temp_type,
         template_class
   </sql>
   
   <!-- 属性sql -->
@@ -61,9 +67,10 @@
         #{item.status},
         #{item.remark},
         #{item.companyId},
         #{item.code}
         #{item.code},
         #{item.tempType},
         #{item.templateClass}
   </sql>
   <!-- where sql -->
   <sql id="where_sql">
       
@@ -86,6 +93,12 @@
         <if test="(record.companyId!=null and record.companyId!='') or  (record.companyId!='' and record.companyId==0)  ">
            and company_id  = #{record.companyId} 
         </if>
            <if test="(record.tempType!=null and record.tempType!='') or  (record.tempType!='' and record.tempType==0)  ">
            and tempType  = #{record.tempType}
         </if>
      </if>
       
   </sql>
@@ -140,6 +153,10 @@
         <if test="_parameter.containsKey('code')">
            code = #{code},
         </if>
         <if test="_parameter.containsKey('temp_type')">
            temp_type = #{tempType},
         </if>
      </set>
      WHERE id=#{id} 
   </update> 
@@ -167,6 +184,11 @@
         <if test="record.code != null and record.code != '' ">
            code  = #{record.code},
         </if>
         <if test="record.tempType != null and record.tempType != '' ">
            temp_type  = #{record.tempType},
         </if>
      </set>
      WHERE id=#{record.id} 
   </update>
@@ -198,8 +220,19 @@
   
   <!-- 分页查询 -->
   <select id="selectInPage" resultMap="ShopWxtemplateMsgMap">
      select
      <include refid="columns" ></include>
      select
      create_by,
      create_time,
      update_by,
      update_time,
      id,
      name,
      uuid,
      status,
      remark,
      company_id,
      code,
      temp_type
      from shop_wxtemplate_msg
      <where>
        <include refid="where_sql"></include>
@@ -248,7 +281,7 @@
      select
      <include refid="columns" ></include>
      from shop_wxtemplate_msg
      where  code=#{code}
      where  code=#{code} and company_id=#{companyId}
   </select>