package net.wicp.tams.app.duckula.controller.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import net.wicp.tams.app.duckula.controller.bean.models.SysOptitem;
import net.wicp.tams.app.duckula.controller.bean.models.SysOptitemExample;

public interface SysOptitemMapper extends BaseMapper<SysOptitem> {

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	long countByExample(SysOptitemExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	int deleteByExample(SysOptitemExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	@Delete({ "delete from sys_optitem", "where id = #{id,jdbcType=BIGINT}" })
	int deleteByPrimaryKey(Long id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	@Insert({ "insert into sys_optitem (id, item_code, ", "parent_id, parent_id_old, ", "group_code, name_zh, ",
			"name_en, order_no, ", "field1, field2, ", "field3, field4, ", "remark, status, ",
			"status_parent, create_time)", "values (#{id,jdbcType=BIGINT}, #{itemCode,jdbcType=VARCHAR}, ",
			"#{parentId,jdbcType=BIGINT}, #{parentIdOld,jdbcType=BIGINT}, ",
			"#{groupCode,jdbcType=VARCHAR}, #{nameZh,jdbcType=VARCHAR}, ",
			"#{nameEn,jdbcType=VARCHAR}, #{orderNo,jdbcType=INTEGER}, ",
			"#{field1,jdbcType=VARCHAR}, #{field2,jdbcType=VARCHAR}, ",
			"#{field3,jdbcType=VARCHAR}, #{field4,jdbcType=VARCHAR}, ",
			"#{remark,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, ",
			"#{statusParent,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})" })
	int insert(SysOptitem record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	int insertSelective(SysOptitem record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	List<SysOptitem> selectByExample(SysOptitemExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	@Select({ "select", "id, item_code, parent_id, parent_id_old, group_code, name_zh, name_en, order_no, ",
			"field1, field2, field3, field4, remark, status, status_parent, create_time", "from sys_optitem",
			"where id = #{id,jdbcType=BIGINT}" })
	@ResultMap("net.wicp.tams.app.duckula.controller.dao.SysOptitemMapper.BaseResultMap")
	SysOptitem selectByPrimaryKey(Long id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	int updateByExampleSelective(@Param("record") SysOptitem record, @Param("example") SysOptitemExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	int updateByExample(@Param("record") SysOptitem record, @Param("example") SysOptitemExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	int updateByPrimaryKeySelective(SysOptitem record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optitem
	 * @mbg.generated
	 */
	@Update({ "update sys_optitem", "set item_code = #{itemCode,jdbcType=VARCHAR},",
			"parent_id = #{parentId,jdbcType=BIGINT},", "parent_id_old = #{parentIdOld,jdbcType=BIGINT},",
			"group_code = #{groupCode,jdbcType=VARCHAR},", "name_zh = #{nameZh,jdbcType=VARCHAR},",
			"name_en = #{nameEn,jdbcType=VARCHAR},", "order_no = #{orderNo,jdbcType=INTEGER},",
			"field1 = #{field1,jdbcType=VARCHAR},", "field2 = #{field2,jdbcType=VARCHAR},",
			"field3 = #{field3,jdbcType=VARCHAR},", "field4 = #{field4,jdbcType=VARCHAR},",
			"remark = #{remark,jdbcType=VARCHAR},", "status = #{status,jdbcType=VARCHAR},",
			"status_parent = #{statusParent,jdbcType=VARCHAR},", "create_time = #{createTime,jdbcType=TIMESTAMP}",
			"where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(SysOptitem record);
}